/* Center the entire clauses section */
.cm-clauses {
  max-width: 600px;    /* Limit the width */
  margin: 20px auto;   /* Center horizontally with auto left/right margins */
  padding: 10px;
  text-align: center;  /* Center the content (e.g., the heading) */
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
}

/* Style each clause item */
.clause-item {
  display: flex;            /* Use flexbox for alignment */
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;       /* Add some padding for spacing */
  margin-bottom: 10px;      /* Space between items */
  border-bottom: 1px solid #eee; /* Light bottom border for separation */
}

/* Make sure the last clause item does not have a bottom border */
.clause-item:last-child {
  border-bottom: none;
}

/* Align the label (clause title) to the left */
.clause-item label {
  flex: 1;                  /* Take available space */
  text-align: left;
  margin-right: 15px;       /* Space between the title and the button */
  font-weight: bold;
}

/* Style the Edit Clause button */
.edit_clause {
  flex-shrink: 0;
  padding: 8px 12px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

/* Add hover effect for the Edit Clause button */
.edit_clause:hover {
  background-color: #2980b9;
}

/* Modal container: full-screen overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Ensure it appears on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
}

/* Modal content box */
.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Centers the box vertically and horizontally */
    padding: 20px;
    border: 1px solid #888;
    width: 50%; /* Adjust width as needed */
    border-radius: 5px;
    position: relative;
}

/* Close button styling */
.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 10px;
    top: 5px;
}

.modal .close:hover,
.modal .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Business Profile Container */
.business-profile {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Business Logo Styling */
.business-logo {
  margin-right: 20px;
  flex-shrink: 0;
}

.business-logo img {
  width: 150px;
  height: auto;
  border-radius: 5px;
  border: 1px solid #ddd;
}

/* Business Details Styling */
.business-details {
  flex: 1;
}

.business-details h2 {
  font-size: 24px;
  margin: 0 0 10px;
  color: #333;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.business-details p {
  margin: 5px 0;
  font-size: 16px;
  color: #555;
  line-height: 1.4;
}

/* Milestone Payments Section Container */
.milestone-payments {
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Milestone Payments Heading */
.milestone-payments h3 {
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
  color: #333;
}

/* Individual Milestone Block */
.milestone_payment {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.3s ease;
}

.milestone_payment:hover {
  background-color: #f1f1f1;
}

/* Milestone Labels */
.milestone_payment label {
  font-weight: bold;
  color: #555;
  margin-bottom: 5px;
}

/* Milestone Inputs & Textareas */
.milestone_payment input[type="text"],
.milestone_payment textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 14px;
  color: #333;
}

/* Add Milestone Button */
#add_milestone {
  display: block;
  width: fit-content;
  margin: 0 auto;
  background-color: #3498db;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

#add_milestone:hover {
  background-color: #2980b9;
}

/* Optional: Remove Milestone Button (if implemented) */
.remove_milestone {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-end;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.remove_milestone:hover {
  background-color: #c0392b;
}

/* Container for the form and preview */
.contract-container {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 1200px; /* Maximum container width */
  margin: 20px auto;
  gap: 20px;
  box-sizing: border-box;
}

/* Left Column: Form */
.contract-form-left {
  flex: 1 1 60%;  /* Grow/shrink; base width of 60% */
  min-width: 400px;  /* Prevent too narrow a column */
  box-sizing: border-box;
  padding-right: 20px;
}

/* Right Column: Preview */
.contract-preview-right {
  flex: 1 1 40%;  /* Grow/shrink; base width of 40% */
  min-width: 300px;  /* Prevent too narrow a column */
  box-sizing: border-box;
  padding-left: 20px;
  background-color: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 20px;
  overflow-y: auto;
}

/* Responsive: Stack columns on small screens */
@media (max-width: 800px) {
  .contract-container {
    flex-direction: column;
  }
  .contract-form-left,
  .contract-preview-right {
    flex: 1 1 100%;
    padding: 0;
  }
}
