/*************************************************************
 * RESET & BASE
*************************************************************/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: #C8C7C7;
  color: #333333;
  padding: 0;
  overflow-y: auto;
  min-height: 100vh;
}
button, input, select {
  font-family: inherit;
}

/*************************************************************
 * APP CONTAINER
*************************************************************/
.app-container {
  max-width: 800px; 
  width: 100%;
  margin: 0 auto;
  background-color: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100vh;
}

/*************************************************************
 * HEADER
*************************************************************/
.app-header {
  background: #2E1A46; /* Primary brand color */
  color: #FFFFFF;
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid #63656A;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.app-header p {
  font-size: 1rem;
  opacity: 0.9;
}

/*************************************************************
 * CONTACT BANNER
*************************************************************/
.contact-banner {
  background-color: #63656A;
  color: #FFFFFF;
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
  border-bottom: 1px solid #4A4A4A;
  position: relative;
}
.contact-banner strong {
  font-size: 1.2rem;
}
.contact-banner a {
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
}
.contact-banner a:hover {
  text-decoration: underline;
}
.linkedin-btn {
  background-color: #0077B5; /* LinkedIn Blue */
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  cursor: pointer;
}
.linkedin-btn:hover {
  background-color: #005582; /* Darker LinkedIn Blue on hover */
}

/*************************************************************
 * PROGRESS INDICATOR
*************************************************************/
.progress-container {
  width: 100%;
  background-color: #E0E0E0;
  height: 8px;
  position: relative;
  margin-top: 0.5rem;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background-color: #4A90E2;
  transition: width 0.4s ease;
}

/*************************************************************
 * MAIN CONTENT + FORM GROUPS
*************************************************************/
.app-content {
  flex: 1 0 auto;
  padding: 1rem;
  position: relative;
}
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: #333333;
}
.lease-term {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border: 1px solid #63656A;
  border-radius: 8px;
  background-color: #FFFFFF;
  color: #333333;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group select:focus {
  border-color: #4A90E2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.form-group small {
  display: block;
  margin-top: 0.3rem;
  color: #8E8E93;
  font-size: 0.8rem;
}
.error {
  color: #FF3B30; 
  font-size: 0.8rem;
  margin-top: 0.3rem;
  line-height: 1.2;
}

/*************************************************************
 * BUTTONS
*************************************************************/
.btn {
  display: inline-block;
  background-color: #4A90E2; /* New Theme Color */
  color: #FFFFFF;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0.5rem;
  transition: background-color 0.3s ease, transform 0.1s ease;
}
.btn:hover {
  background-color: #357ABD; /* Darker Shade on Hover */
}
.btn:active {
  transform: scale(0.98);
}
.reset-btn {
  background-color: #D18E00; /* Updated Reset Button Color */
  color: #FFFFFF;
  margin: 1rem auto 0; /* Centered */
  display: none; /* Hidden by default */
  width: 200px;
}
.reset-btn.hidden {
  display: none;
}
.reset-btn:not(.hidden) {
  display: block;
}
.reset-btn:hover {
  background-color: #B07400; /* Darker Shade on Hover */
}

/* New Calculate Button Styling */
.calculate-btn {
  background-color: #28A745; /* Green color to distinguish */
  color: #FFFFFF;
  display: block;
  margin: 0 auto; /* Center the button */
  width: 220px;
}
.calculate-btn:hover {
  background-color: #218838; /* Darker Green on Hover */
}

/*************************************************************
 * RESULT BOX
*************************************************************/
.result-container {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 8px;
  background-color: #FFF8E1; /* Light yellow background */
  border-left: 5px solid #4A90E2; /* Updated Highlight border */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.5s ease;
}
.result-container.visible {
  display: block;
  opacity: 1;
}
.result {
  font-size: 1rem;
  font-weight: 500;
  color: #333333;
  white-space: pre-line;
}
.result.success {
  color: #333333;
}
.result.error {
  color: #D32F2F;
}

/*************************************************************
 * SCREEN TOGGLE
*************************************************************/
.hidden {
  display: none;
}
.screen {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.5s ease, max-height 0.5s ease;
  display: none; /* Ensuring default is hidden */
}
.screen.active {
  display: block; /* Make visible */
  opacity: 1;
  max-height: 10000px; /* Effectively visible */
}

/*************************************************************
 * RENT TABLE STYLING
*************************************************************/
.rent-table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
  border-radius: 10px;
  background-color: #FFFFFF;
  padding: 0.8rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-bottom: 0.5rem;
}
.modern-table thead th {
  background-color: #4A90E2; /* Updated Header Color */
  font-weight: 600;
  padding: 0.6rem;
  text-align: left;
  border-bottom: 1px solid #63656A; /* Updated border color */
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  font-size: 0.9rem;
  color: #FFFFFF;
}
.modern-table tbody tr {
  background-color: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: background-color 0.2s ease;
}
.modern-table tbody tr:hover {
  background-color: #F0F8FF; /* Light Blue Hover */
}
.modern-table td {
  padding: 0.6rem;
  border-bottom: 1px solid #E3F2FD;
  vertical-align: middle;
  font-size: 0.9rem;
  color: #333333;
}
.modern-table tr:last-child td {
  border-bottom: none;
}
.rent-value {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: none;
  background-color: transparent;
  color: #333333;
  font-size: 0.9rem;
  text-align: right;
}

/*************************************************************
 * COMMISSION STRUCTURE INFO BOX
*************************************************************/
.structure-info {
  background: #E6F0FF; /* Light Blue Background */
  border-left: 4px solid #4A90E2; /* Updated Highlight Border */
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  color: #333333;
  font-size: 0.85rem;
}
.structure-info h4 {
  margin-bottom: 0.4rem;
  color: #4A90E2; /* Updated Highlight Color */
  font-weight: 600;
  font-size: 1rem;
}
.structure-info ul {
  list-style: inside disc;
  margin-left: 1rem;
}
.structure-info ul li {
  margin-bottom: 0.3rem;
}

/*************************************************************
 * LEASE TERM SUMMARY
*************************************************************/
.term-summary {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #555555;
}
.term-summary strong {
  color: #333333;
}

/*************************************************************
 * ACCORDION BUTTON
*************************************************************/
#toggleRentTableBtn {
  background-color: #4A90E2; /* Updated to match new theme */
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}
#toggleRentTableBtn:hover {
  background-color: #357ABD; /* Darker Shade on Hover */
}

/*************************************************************
 * BUTTON GROUPS
*************************************************************/
.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.split-btn, .team-split-btn, .toggle-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  background-color: #E0E0E0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.split-btn:hover, .team-split-btn:hover, .toggle-btn:hover {
  background-color: #BDBDBD;
}
.split-btn.active, .team-split-btn.active, .toggle-btn.active {
  background-color: #4A90E2;
  color: #FFFFFF;
}
#brokerageSplitCustom, #teamSubSplitRetailCustom, #teamSubSplitOfficeCustom {
  margin-top: 0.5rem;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}
#brokerageSplitCustom.hidden, #teamSubSplitRetailCustom.hidden, #teamSubSplitOfficeCustom.hidden {
  opacity: 0;
  max-height: 0;
  display: none;
}
#brokerageSplitCustom.visible, #teamSubSplitRetailCustom.visible, #teamSubSplitOfficeCustom.visible {
  opacity: 1;
  max-height: 100px;
  display: block;
}

/*************************************************************
 * MEDIA QUERIES (Optional for Better Responsiveness)
*************************************************************/
@media (max-width: 600px) {
  .lease-term {
    flex-direction: column;
  }
  .button-group {
    flex-direction: column;
  }
}
