* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 1em;
    font-weight: 400;
    line-height: 1.6;
    padding: 60px 15px 30px 15px; /* Restore padding to prevent text overlap */
    text-align: center;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #0a192f; /* Fallback color while image loads */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: url('images/background.jpg') no-repeat center center;
    background-size: cover;
    /* Removed fixed attachment for better mobile performance */
    will-change: transform; /* Hardware acceleration hint */
    transform: translateZ(0); /* Force GPU rendering */
    -webkit-backface-visibility: hidden; /* Prevent flickering */
    backface-visibility: hidden;
    perspective: 1000;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(0px); /* Removed blur */
    z-index: 0;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}



.language-selector {
  position: fixed !important;  /* Makes it sticky during scroll */
  top: 0 !important;           /* Positioned at very top */
  right: 0 !important;         /* Positioned at very right */
  z-index: 1000 !important;    /* Higher z-index to ensure it's on top */
  background: rgba(255, 255, 255, 0.1);  /* Semi-transparent white background */
  backdrop-filter: blur(8px);  /* Blur effect behind */
  -webkit-backdrop-filter: blur(8px);  /* For Safari support */
  padding: 10px 20px;        /* 10px top/bottom, 20px left/right padding */
  border-radius: 0 0 0 20px;  /* Only bottom-left corner rounded */
  border: 1px solid rgba(255, 255, 255, 0.15);  /* Thin white border */
  font-size: 0.9em;          /* Text size */
  color: rgba(255, 255, 255, 0.5);  /* Text color */
  margin: 0 !important;       /* No margin */
  box-sizing: border-box;    /* Include padding and border in element's dimensions */
  width: auto;               /* Auto width based on content */
  transform: translate(0, 0) !important; /* Prevent any transforms */
  max-width: none !important; /* Prevent max-width constraints */
}

/* Mobile-specific styles to ensure language selector stays in corner */
@media (max-width: 768px) {
  .language-selector {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    padding: 8px 15px !important;
    font-size: 0.8em !important;
  }
}

/* No hover effect for the selector itself */

.language-selector span {
  cursor: pointer;
  padding: 0 3px;
  transition: color 0.2s;
}

.language-selector span:hover {
  color: #26c6da;
}

/* Separator styling - The vertical bars between languages */
.language-selector span + span {
  margin-left: 2px;  /* 2px margin before each span after the first */
}

/* The More dropdown trigger */
.more-languages {
  position: relative;
  cursor: pointer;
}

/* The dropdown itself has styling, but the main selector doesn't have a box */
.language-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: rgba(30, 40, 60, 0.95);  /* Dark blue with 95% opacity */
  padding: 10px;                        /* 10px padding all around */
  border-radius: 8px;                   /* 8px rounded corners */
  margin-top: 5px;                      /* 5px margin from trigger */
  z-index: 100;                         /* z-index 100 */
  min-width: 180px;                     /* Minimum width 180px */
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* Shadow */
  display: none;
}

.dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropdown-section span {
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
  box-sizing: border-box;
  color: #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.dropdown-section span:hover {
  background: rgba(38, 198, 218, 0.2);
  color: #ffffff;
  transform: translateX(2px);
}

.dropdown-section span:active {
  background: rgba(38, 198, 218, 0.3);
}

.dropdown-section span i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
  color: #26c6da;
  transition: transform 0.2s ease;
}

.dropdown-section span:hover i {
  transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .language-selector {
    top: 10px;
    right: 10px;
    font-size: 0.75em;
  }
  
  .language-dropdown {
    min-width: 160px;
    padding: 8px;
  }
  
  .dropdown-section span {
    padding: 4px 8px;
  }
}

.refresh-rates {
    cursor: pointer;
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.refresh-rates:hover {
    background-color: #e0e0e0;
    color: #333;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
    font-size: 2.5em;
    color: #00ddeb;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 221, 235, 0.3);
}

/* Crypto Popup Modal Styles */
.about-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.about-popup {
    background: rgba(30, 40, 60, 0.95);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(38, 198, 218, 0.3);
}

.popup-header {
    text-align: center;
    margin-bottom: 20px;
}

.popup-header h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-button:hover {
    color: #ffffff;
}

.about-content {
    color: #e2e8f0;
}

.content-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(45, 55, 72, 0.3);
    border-radius: 8px;
    border-left: 3px solid #26c6da;
}

.content-section h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #ffffff;
    display: flex;
    align-items: center;
}

.section-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.read-time {
    text-align: center;
    color: #a0aec0;
    font-size: 0.9em;
    margin-top: -10px;
    margin-bottom: 20px;
}

/* Crypto popup specific styles */
.crypto-popup {
    border-color: rgba(247, 147, 26, 0.3);
}

.crypto-popup .content-section {
    border-left-color: #f7931a;
}

/* About Popup Styles with Exact Positioning */
.about-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.about-popup {
  background: rgba(30, 40, 60, 0.95);
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(38, 198, 218, 0.3);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #e2e8f0;
}

.popup-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.popup-header h2 {
  font-size: 1.5rem;
  color: #ffffff;
  margin: 0;
  font-weight: 600;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  color: #ffffff;
}

.about-content {
  color: #e2e8f0;
}

.content-section {
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(45, 55, 72, 0.3);
  border-radius: 8px;
  border-left: 3px solid #26c6da;
}

.intro-section {
  background: rgba(45, 55, 72, 0.4);
}

.content-section h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 15px;
  color: #ffffff;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.section-icon {
  margin-right: 10px;
  font-size: 1.2em;
}

.content-section p {
  margin-bottom: 15px;
  line-height: 1.6;
  margin-top: 0;
  color: #e2e8f0;
}

/* Steps container styling */
.steps-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  background: rgba(38, 198, 218, 0.1);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(38, 198, 218, 0.2);
}

.step-number {
  background: #26c6da;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 10px;
  flex-shrink: 0;
}

.step-item p {
  margin: 0;
  font-size: 0.9em;
}

/* Features grid styling */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.feature-item {
  background: rgba(45, 55, 72, 0.5);
  padding: 15px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.feature-title {
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.feature-item p {
  font-size: 0.85em;
  margin: 0;
  color: #a0aec0;
}

/* Divider styling */
.language-dropdown > div[style*="height: 1px"] {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 0;
  border-radius: 1px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .language-selector {
    top: 10px;
    right: 10px;
    font-size: 0.75em;
    padding: 5px 8px;
  }
  
  .language-dropdown {
    min-width: 160px;
    padding: 8px;
    right: -5px; /* Adjust position on mobile */
  }
  
  .dropdown-section span {
    padding: 4px 8px;
    font-size: 0.95em;
  }
  
  .dropdown-section span i {
    margin-right: 6px;
  }
  
  .about-popup {
    padding: 20px;
    max-height: 80vh;
  }
  
  .popup-header h2 {
    font-size: 1.3rem;
  }
  
  .content-section {
    padding: 15px;
  }
  
  .steps-container,
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .step-item,
  .feature-item {
    padding: 12px;
  }
}

/* No sticky scroll behavior - the selector is positioned absolutely */

/* Scrollbar styling for the popup */
.about-popup::-webkit-scrollbar {
  width: 8px;
}

.about-popup::-webkit-scrollbar-track {
  background: rgba(30, 40, 60, 0.5);
  border-radius: 4px;
}

.about-popup::-webkit-scrollbar-thumb {
  background: rgba(38, 198, 218, 0.3);
  border-radius: 4px;
}

.about-popup::-webkit-scrollbar-thumb:hover {
  background: rgba(38, 198, 218, 0.5);
}

.intro-section {
    background: rgba(45, 55, 72, 0.4);
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.content-section ul {
    margin: 0;
    padding-left: 20px;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.content-section strong {
    color: #ffffff;
}

@media (max-width: 768px) {
    .about-popup {
        padding: 20px;
        max-height: 80vh;
    }
    
    .popup-header h2 {
        font-size: 1.3rem;
    }
    
    .content-section {
        padding: 15px;
    }
}

/* Tool Button Grid Layout */
.tool-button-wrapper {
  width: 100%;
  height: 180px;
  min-height: 180px;
  margin: 0;
  position: relative;
  border-radius: 12px;
  background: rgba(30, 40, 60, 0.2);
  border: 1px solid rgba(38, 198, 218, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.tool-button-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px; 
  background: linear-gradient(90deg, #26c6da, #64b5f6); 
  opacity: 0.7; 
  transition: all 0.3s ease; 
}

.tool-button-wrapper:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3); 
  border-color: rgba(38, 198, 218, 0.4); 
}

.tool-button-wrapper:hover::before { 
  opacity: 1; 
  height: 3px; 
}

/* Tool Button Container */ 
.tool-button { 
  width: 64px; 
  height: 64px; 
  min-width: 64px; 
  min-height: 64px; 
  background: linear-gradient(135deg, rgba(30, 40, 60, 0.9), rgba(20, 25, 40, 0.9)); 
  border-radius: 10px; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  margin: 0 auto 15px auto; 
  position: relative; 
  overflow: hidden; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 
  border: 1px solid rgba(255, 255, 255, 0.05); 
}

.tool-link { 
  text-decoration: none; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  width: 100%; 
  height: 100%; 
  padding: 10px; 
  box-sizing: border-box; 
}

.tool-icon { 
  font-size: 32px !important; 
  color: #26c6da !important; 
  margin-bottom: 0; 
  width: 32px; 
  height: 32px; 
}

.tool-title { 
  font-family: 'Orbitron', 'Inter', Arial, sans-serif; 
  font-size: 0.95rem; 
  font-weight: 600; 
  letter-spacing: 0.01em; 
  margin: 5px 0 4px 0; 
  color: #fff; 
  text-align: center; 
  width: 100%; 
}

.tool-description { 
  font-size: 0.8rem; 
  color: #a0aec0; 
  font-weight: 400; 
  margin: 0; 
  text-align: center; 
  width: 100%; 
}

/* Button glow effect */ 
.button-glow { 
  position: absolute; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  width: 0; 
  height: 0; 
  background: radial-gradient(circle, rgba(247, 147, 26, 0.4) 0%, rgba(247, 147, 26, 0) 70%); 
  border-radius: 50%; 
  opacity: 0; 
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); 
}

.tool-button:hover .button-glow { 
  width: 120px; 
  height: 120px; 
  opacity: 0.8; 
}

/* Mobile Responsiveness */ 
@media (max-width: 600px) { 
  .tool-buttons-grid { 
    grid-template-columns: 1fr !important; 
    gap: 15px !important; 
  }

  .tool-button-wrapper { 
    width: 100%; 
    height: 120px; 
    min-height: 120px; 
    margin: 0; 
    padding: 10px; 
  }

  .tool-button { 
    width: 50px; 
    height: 50px; 
    min-width: 50px; 
    min-height: 50px; 
    margin-bottom: 10px; 
  } 
}

p.subtitle {
    font-size: 1.2em;
    color: #d5e1ef;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-bottom: 24px;
    opacity: 0.95;
}

.calc-box {
    background: rgba(30, 40, 60, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(38, 198, 218, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    margin: 30px auto;
    max-width: 600px;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.calc-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.tab-label {
    background: none;
    border: none;
    padding: 12px 20px;
    text-align: center;
    cursor: pointer;
    color: #d5e1ef;
    font-size: 1em;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-label:hover {
    color: #00ddeb;
}

.tab-label.active {
    color: #00ddeb;
    background: rgba(26, 32, 44, 0.7);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.tab-label.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #00ddeb, #0288d1);
    border-radius: 2px;
}

.calc-body .calc-mode {
    display: none;
}

.calc-body .calc-mode.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(38, 198, 218, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(38, 198, 218, 0.6); }
    100% { box-shadow: 0 4px 15px rgba(38, 198, 218, 0.4); }
}
.calc-card {
    background: rgba(26, 32, 44, 0.7);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.calc-mode h3 {
    font-size: 1.5em;
    color: #00ddeb;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
}

.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

/* Hide placeholder text so it doesn't overlap with labels */
.input-group input::placeholder {
    color: transparent;
}

/* Center placeholders for specific input fields */
#buyer-closing-costs::placeholder,
#buyer-property-tax::placeholder,
#buyer-insurance::placeholder {
    color: #fff;
    opacity: 1;
    text-align: center;
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #d5e1ef;
    font-size: 0.95em;
    font-weight: 400;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Move input labels out of the way when field is focused or has content */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%);
    background: rgba(20, 35, 55, 0.85);
    font-size: 0.75em;
    padding: 0 8px;
    color: #00ddeb;
    z-index: 1;
}

/* Prevent wrapping for property taxes and homeowners insurance labels in all views */
#buyer-property-tax:not(:placeholder-shown) + label,
#buyer-insurance:not(:placeholder-shown) + label {
    white-space: nowrap;
    font-size: 0.7em; /* Slightly smaller font to fit better */
    max-width: 90%; /* Ensure it doesn't overflow the container */
}

/* Fix for select dropdowns to always show labels above */
.input-group select + label {
    top: 0;
    transform: translateY(-50%);
    background: rgba(20, 35, 55, 0.85);
    font-size: 0.75em;
    padding: 0 8px;
    color: #00ddeb;
    z-index: 1;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #00ddeb;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 8px rgba(0, 221, 235, 0.3);
}

/* Style for form inputs to match custom select buttons */
#buyer-rate-preset,
#buyer-pmi-rate,
#buyer-closing-costs,
#buyer-extra-payment {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95em;
    color: #e2e8f0;
    background: rgba(45, 55, 72, 0.7);
    border: 1px solid #4a5568;
    border-radius: 6px;
    transition: all 0.2s ease;
    height: 48px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Hover state for all inputs */
#buyer-rate-preset:hover,
#buyer-pmi-rate:hover,
#buyer-closing-costs:hover,
#buyer-extra-payment:hover {
    background: rgba(56, 65, 85, 0.8);
    border-color: #26c6da;
}

/* Focus state for all inputs */
#buyer-rate-preset:focus,
#buyer-pmi-rate:focus,
#buyer-closing-costs:focus,
#buyer-extra-payment:focus {
    background: rgba(56, 65, 85, 0.8);
    border-color: #26c6da;
    box-shadow: 0 0 0 1px #26c6da;
    outline: none;
}

/* Style for the dropdown arrow */
#buyer-rate-preset {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}

/* Ensure consistent spacing */
.input-group {
    margin-bottom: 15px;
}

/* Center floating labels for specific fields */
#buyer-closing-costs + label,
#buyer-property-tax + label,
#buyer-insurance + label {
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
}

#buyer-closing-costs:focus + label,
#buyer-closing-costs:not(:placeholder-shown) + label,
#buyer-property-tax:focus + label,
#buyer-property-tax:not(:placeholder-shown) + label,
#buyer-insurance:focus + label,
#buyer-insurance:not(:placeholder-shown) + label {
    opacity: 1;
    visibility: visible;
}

/* Center placeholder text for specific input fields */
#buyer-closing-costs,
#buyer-property-tax,
#buyer-insurance {
    text-align: center;
}

/* Override placeholder styling for specific input fields */
#buyer-closing-costs::placeholder,
#buyer-property-tax::placeholder,
#buyer-insurance::placeholder {
    color: #fff;
    opacity: 1;
    text-align: center;
}

/* Checkbox Group Styling */
.checkbox-group {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(26, 32, 44, 0.7);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Escrow Container */
.escrow-container {
    margin: 15px 0;
}

/* Escrow Fields Container - Hidden by default */
.escrow-fields {
    display: none;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 221, 235, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0 20px 0;
    transition: all 0.3s ease;
}

/* Show escrow fields when checkbox is checked */
#buyer-escrow:checked ~ .escrow-fields {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Style for the escrow checkbox */
.escrow-container .checkbox-group {
    margin-bottom: 0;
}



.checkbox-group:hover {
    background: rgba(255, 255, 255, 0.08);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #00ddeb;
}

.checkbox-group label {
    color: #d5e1ef;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.95em;
}

.nested-checkbox {
    margin-left: 16px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

/* Ensure the calculator container expands properly */
.calc-card {
    overflow: visible;
}

/* Make sure the affordability section has proper padding on mobile */
@media only screen and (max-width: 768px) {
    .escrow-fields.active,
    .crypto-fields.active {
        padding-bottom: 20px;
    }
    
    .nested-checkbox {
        margin-left: 8px;
        margin-right: 8px;
    }
}

/* Budget Slider Styles */
.slider::-webkit-slider-thumb { 
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #26c6da;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #26c6da;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.form-step {
  margin-bottom: 15px;
}

.text-sm {
  font-size: 0.875rem;
}

.text-white {
  color: #ffffff;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

/* Down payment preset buttons */
.down-payment-preset {
  background-color: rgba(38, 198, 218, 0.1);
  border: 1px solid rgba(38, 198, 218, 0.3);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.down-payment-preset:hover {
  background-color: rgba(38, 198, 218, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.down-payment-preset:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.down-payment-preset.active {
  background-color: rgba(38, 198, 218, 0.3);
  border-color: rgba(38, 198, 218, 0.5);
  font-weight: 500;
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Affordability Button Styling */
.affordability-btn {
    display: inline-block;
    width: auto;
    padding: 12px 24px;
    margin: 0;
    background: linear-gradient(135deg, #6b46c1 0%, #9f7aea 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.5px;
}

.affordability-btn:hover {
    background: linear-gradient(135deg, #805ad5 0%, #b794f4 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.affordability-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Loan Details Summary Styling */
#loan-details-summary {
    display: none;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background-color: rgba(20, 35, 55, 0.85);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
}

#loan-details-summary.active {
    display: block;
}

#loan-details-summary h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

#loan-details-summary .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    padding-bottom: 3px;
}

#loan-details-summary .detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

#loan-details-summary .detail-row span:first-child {
    color: #ccc;
    font-weight: 500;
}

#loan-details-summary .detail-row span:last-child {
    font-weight: 600;
    color: white;
}

/* Loan Summary Styling for Calculation Results */
.loan-summary-results {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    background-color: rgba(20, 35, 55, 0.85);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

.loan-summary-results h4 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 14px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
    text-align: center;
}

.loan-summary-results .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.loan-summary-results .detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.loan-summary-results .detail-row span:first-child {
    color: #ccc;
    font-weight: 500;
    padding-right: 8px;
}

.loan-summary-results .detail-row span:last-child {
    font-weight: 600;
    color: white;
    text-align: right;
}

/* Underline for Total Interest row */
.loan-summary-results .detail-row.underlined {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

/* Total Paid styling */
.loan-summary-results .detail-row.total span:last-child {
    font-weight: 700;
    font-size: 1.05em;
}

/* Make Total Paid value blue */
.loan-summary-results .detail-row.total span:last-child {
    color: #00ddeb;
}

/* Affordability Quick Results Styling */
#affordability-quick-results {
    margin-top: 16px;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.4s ease-in-out;
}

#affordability-quick-results.active {
    max-height: 600px;
    opacity: 1;
    padding: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    background: rgba(0, 221, 235, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(0, 221, 235, 0.3);
}

/* Affordability Fields */
#affordability-fields {
    display: none; /* Hidden by default */
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 221, 235, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

#affordability-fields.active {
    display: block;
}

/* Affordability Results Styling - Condensed */
.affordability-results {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    background: rgba(0, 221, 235, 0.05);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

.affordability-results h4 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 14px;
    color: #00ddeb;
    text-align: center;
    border-bottom: 1px solid rgba(0, 221, 235, 0.3);
    padding-bottom: 3px;
}

.affordability-results .result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.affordability-results .result-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.affordability-results .result-row span:first-child {
    font-weight: 500;
    padding-right: 8px;
}

.affordability-results .result-row span:last-child {
    font-weight: 600;
    text-align: right;
}

/* Make only the Recommended Monthly Payment value blue */
.affordability-results .result-row:nth-of-type(2) span:last-child {
    color: #00ddeb !important;
}

/* First-Time Buyer Resources Styling - Condensed */
.first-time-buyer-resources {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

.first-time-buyer-resources h4 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

.first-time-buyer-resources .result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.first-time-buyer-resources .result-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.first-time-buyer-resources .result-row span:first-child {
    font-weight: 500;
    padding-right: 8px;
}

.first-time-buyer-resources .result-row span:last-child {
    font-weight: 600;
    text-align: right;
}

.condensed-resources {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 6px;
    gap: 5px;
}

.resource-column {
    flex: 1;
    min-width: 120px;
    padding: 0 5px;
    text-align: left;
    margin-bottom: 5px;
}

.resource-column h5 {
    color: #00ddeb;
    margin-bottom: 4px;
    font-size: 0.95em;
    text-align: center;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(0, 221, 235, 0.2);
}

.resource-column ul {
    padding-left: 10px;
    margin: 0;
    font-size: 0.85em;
    list-style-type: none;
}

.resource-column li {
    margin-bottom: 3px;
    line-height: 1.2;
    position: relative;
    padding-left: 10px;
}

.resource-column li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #00ddeb;
}

.resource-column a {
    color: #4dabf7;
    text-decoration: none;
    transition: color 0.2s ease;
}

.resource-column a:hover {
    color: #00ddeb;
    text-decoration: underline;
}

@media only screen and (max-width: 600px) {
    .condensed-resources {
        flex-direction: column;
    }
    
    .resource-column {
        margin-bottom: 15px;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    .results-container, .results-container * {
        visibility: visible;
    }
    .results-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print, button, .reset-btn {
        display: none !important;
    }
}

/* Styling for field information text */
.field-info {
    display: block;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    margin-left: 16px;
    font-style: italic;
    text-decoration: none;
}

/* Only make the insurance field-info link turn white on hover */
a.field-info {
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
}

a.field-info:hover,
a.field-info:focus {
    color: #fff;
    text-decoration: underline;
}

/* Combined input group styling */
.combo-input-group {
    position: relative;
    display: flex;
    flex-direction: row;
}

.combo-input-group select {
    flex: 0 0 auto;
    width: 50%;
    border-radius: 8px 0 0 8px;
    border-right: none;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-right: 30px;
}

.combo-input-group input.combo-input {
    flex: 1;
    border-radius: 0 8px 8px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 14px;
    padding-bottom: 14px;
}

.combo-input-group label {
    top: 0;
    left: 16px;
    transform: translateY(-50%);
    background: rgba(20, 35, 55, 0.85);
    font-size: 0.75em;
    padding: 0 8px;
    color: #00ddeb;
    z-index: 1;
}

/* Additional styling for select inputs */
.input-group select {
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d5e1ef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-top: 25px;
    padding-bottom: 10px;
}

.calc-btn {
    width: 100%;
    padding: 14px;
    margin: 20px 0;
    background: linear-gradient(to right, #00ddeb, #0288d1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 221, 235, 0.3);
    transition: all 0.3s ease;
}

.calc-btn:hover {
    background: linear-gradient(135deg, #0dbddd, #1890c5, #0dbddb);
    box-shadow: 0 4px 16px rgba(0, 221, 235, 0.4);
}

/* Reset Button Styling */
.reset-btn {
    width: 100%;
    padding: 12px;
    margin: 15px 0 5px 0;
    background: linear-gradient(to right, #8e44ad, #673ab7);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
    transition: all 0.3s ease;
    opacity: 0.85;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #9b59b6, #7e57c2, #9b59b6);
    box-shadow: 0 4px 16px rgba(142, 68, 173, 0.4);
    opacity: 1;
}

/* Enhanced Results Styling */
.result-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Make the result container transparent but keep the individual result sections with their backgrounds */
#buyer-result, #seller-result, #investor-result, #crypto-result {
    background: transparent;
    padding: 0;
}

/* Crypto Direction Toggle Styles */
.crypto-input-group {
    position: relative;
}

/* Wallet Search Styles */
.wallet-search-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    position: relative;
}

.wallet-search-container .input-group {
    margin-bottom: 12px;
}

.search-btn {
    background: #4db5ff;
    color: #000;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    font-family: inherit;
}

.search-btn:hover {
    background: #3d9fe8;
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(0);
}

.wallet-result-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.wallet-result-container.active {
    max-height: 1000px;
    margin-top: 15px;
}

.chain-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.3);
}

.chain-badge.ethereum {
    background: rgba(113, 89, 241, 0.2);
    color: #9f8aff;
}

.chain-badge.bitcoin {
    background: rgba(247, 147, 26, 0.2);
    color: #f7931a;
}

.chain-badge.solana {
    background: rgba(20, 241, 149, 0.2);
    color: #14f195;
}

.chain-badge.arbitrum {
    background: rgba(41, 103, 255, 0.2);
    color: #2967ff;
}

.chain-badge.polygon {
    background: rgba(130, 71, 229, 0.2);
    color: #8247e5;
}

.chain-badge.optimism {
    background: rgba(255, 4, 32, 0.2);
    color: #ff0420;
}

.chain-badge.base {
    background: rgba(0, 82, 255, 0.2);
    color: #0052ff;
}

.wallet-tx-list {
    margin-top: 16px;
}

.wallet-tx {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.wallet-tx:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.wallet-tx:last-child {
    margin-bottom: 0;
}

.wallet-tx-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
}

.wallet-tx-hash {
    color: #00ddeb;
    text-decoration: none;
    font-family: monospace;
    font-size: 14px;
}

.wallet-tx-hash:hover {
    text-decoration: underline;
}

.wallet-tx-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.wallet-tx-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wallet-tx-direction {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.wallet-tx-direction.in {
    background-color: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.wallet-tx-direction.out {
    background-color: rgba(255, 82, 82, 0.2);
    color: #ff5252;
}

.wallet-tx-amount {
    font-weight: 600;
}

.wallet-tx-chain {
    font-size: 12px;
    opacity: 0.7;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

/* Transaction container with fixed structure - Tesla-inspired minimalism */
.wallet-tx-container {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: visible; /* Allow footer to be visible outside */
    background: rgba(0, 0, 0, 0.1);
    margin-top: 16px;
    margin-bottom: 70px; /* Ensure space for footer */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Scrollable area for transactions */
.wallet-tx-scrollable-area {
    max-height: 550px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    padding: 10px;
}

/* Custom scrollbar for webkit browsers */
.wallet-tx-scrollable-area::-webkit-scrollbar {
    width: 6px;
}

.wallet-tx-scrollable-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.wallet-tx-scrollable-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.wallet-tx-scrollable-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Initial transaction list */
.wallet-tx-list {
    margin-bottom: 16px;
}

/* Additional transactions when expanded */
.wallet-tx-more {
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

/* Show more button container */
.wallet-show-more-btn-container {
    text-align: center;
    margin: 10px 0;
    padding: 5px;
}

.wallet-show-more-btn {
    background: linear-gradient(to right, #00ddeb, #0288d1);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px auto;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.wallet-show-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Tesla-inspired action bar for wallet transactions */
.wallet-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: linear-gradient(to right, rgba(16, 25, 41, 0.8), rgba(10, 20, 35, 0.9));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    width: 100%;
    /* Tesla-inspired styling */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tx-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.view-all-tx-link {
    color: #00ddeb;
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.view-all-tx-link:hover {
    text-decoration: underline;
}

.view-all-tx-link::after {
    content: '→';
    margin-left: 5px;
}

.wallet-paginator {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.paginator-btn {
    background: rgba(77, 181, 255, 0.2);
    color: #4db5ff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.paginator-btn:hover {
    background: rgba(77, 181, 255, 0.3);
}

.paginator-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.crypto-toggle-wrapper {
    position: relative; /* Change to relative positioning */
    display: flex;
    justify-content: center;
    margin: 10px auto 25px; /* Add margin for spacing */
    z-index: 10;
    padding: 5px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.1); /* Subtle background for the toggle area */
    width: fit-content;
}

.crypto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-label {
    margin-right: 10px;
    font-size: 0.9rem;
    color: #888;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3e6ae1;
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px #3e6ae1;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.crypto-view {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crypto-view.active-view {
    display: block;
    opacity: 1;
}

/* Tesla-inspired Wallet Toggle Styles */
.wallet-toggle-wrapper {
    margin-left: 15px;
    display: flex;
    justify-content: center;
}

.wallet-toggle-switch {
    position: relative;
    display: inline-block;
    width: 150px;
    height: 36px;
    margin: 0 auto;
}

.wallet-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wallet-toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 0 5px rgba(77, 181, 255, 0.3), 0 0 10px rgba(0, 0, 0, 0.2) inset;
}

.wallet-toggle-label:hover {
    background: rgba(255, 255, 255, 0.15);
}

.wallet-toggle-inner {
    position: absolute;
    content: "";
    height: 32px;
    width: 75px;
    left: 2px;
    bottom: 2px;
    background-color: #4db5ff;
    border-radius: 30px;
    transition: all 0.3s ease;
    z-index: 1;
}

.wallet-toggle-switch-calc, .wallet-toggle-switch-wallet {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75px;
    height: 100%;
    color: white;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 2;
    line-height: 1.2;
}

.wallet-toggle-switch-calc {
    left: 0;
}

.wallet-toggle-switch-wallet {
    right: 0;
}

input:checked + .wallet-toggle-label .wallet-toggle-inner {
    transform: translateX(71px);
}

input:checked + .wallet-toggle-label .wallet-toggle-switch-calc {
    color: rgba(255, 255, 255, 0.7);
}

input:not(:checked) + .wallet-toggle-label .wallet-toggle-switch-wallet {
    color: rgba(255, 255, 255, 0.7);
}

input:not(:checked) + .wallet-toggle-label .wallet-toggle-switch-calc {
    color: #fff;
}

input:checked + .wallet-toggle-label .wallet-toggle-switch-wallet {
    color: #fff;
}

/* Crypto toggle styles - Tesla-inspired design */
.crypto-toggle-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.crypto-toggle-switch {
    position: relative;
    display: inline-block;
    width: 150px;
    height: 30px;
    margin: 0 auto;
}

.crypto-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.crypto-toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.crypto-toggle-label:hover {
    background: rgba(255, 255, 255, 0.15);
}

.crypto-toggle-inner {
    position: absolute;
    content: "";
    height: 26px;
    width: 75px;
    left: 2px;
    bottom: 2px;
    background-color: #4db5ff;
    border-radius: 30px;
    transition: all 0.3s ease;
    z-index: 1;
}

.crypto-toggle-switch-usd, .crypto-toggle-switch-crypto {
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 75px;
    height: 100%;
    color: white;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 2;
}

.crypto-toggle-switch-usd {
    left: 0;
}

.crypto-toggle-switch-crypto {
    right: 0;
}

input:checked + .crypto-toggle-label .crypto-toggle-inner {
    transform: translateX(71px);
}

input:checked + .crypto-toggle-label .crypto-toggle-switch-usd {
    color: rgba(255, 255, 255, 0.7);
}

input:not(:checked) + .crypto-toggle-label .crypto-toggle-switch-crypto {
    color: rgba(255, 255, 255, 0.7);
}

input:not(:checked) + .crypto-toggle-label .crypto-toggle-switch-usd {
    color: #fff;
}

input:checked + .crypto-toggle-label .crypto-toggle-switch-crypto {
    color: #fff;
}

input:not(:checked) + .crypto-toggle-label .crypto-toggle-switch-crypto {
    color: rgba(255, 255, 255, 0.6);
}

input:checked + .crypto-toggle-label .crypto-toggle-switch-usd {
    color: rgba(255, 255, 255, 0.6);
}

/* Chart styles */
.chart-container {
    max-height: 200px;
    width: 100%;
    margin-top: 15px;
    position: relative;
    padding-bottom: 10px;
}

/* Special height for extra payment chart to ensure labels are visible */
.extra-payment-section .chart-container {
    min-height: 280px; /* Fixed minimum height to ensure enough vertical space */
    height: 280px; /* Fixed height to ensure enough vertical space */
    max-height: none; /* Remove max-height constraint */
    padding-top: 25px; /* Add significant padding at the top for the y-axis label */
    margin-top: 25px; /* Add margin at the top as well */
    margin-left: -15px; /* Negative margin to move chart to the left */
    width: calc(100% + 15px); /* Compensate for the negative margin */
    position: relative; /* Ensure proper positioning */
}

/* Special styling for monthly costs pie chart */
.monthly-costs-section .chart-container {
    min-height: 300px; /* Further increased minimum height */
    height: 300px; /* Further increased fixed height */
    max-height: none; /* Remove max-height constraint */
    padding: 5px 5px 45px 5px; /* Slightly reduced bottom padding */
    margin-top: 15px; /* Keep consistent margin */
    margin-bottom: 25px; /* Slightly reduced bottom margin */
    background-color: transparent; /* Ensure no background */
    overflow: visible; /* Allow content to overflow if needed */
}

/* Extend the Monthly Costs section to fit the full chart and legend */
.monthly-costs-section {
    padding-bottom: 65px !important; /* Slightly reduced padding at the bottom */
    margin-bottom: 15px !important; /* Slightly reduced margin at the bottom */
}

@media (max-width: 576px) {
    .chart-container {
        max-height: 150px;
    }
}

/* Include chart containers within result sections */
.result-section .chart-container,
.loan-summary-results .chart-container,
.first-time-buyer-resources .chart-container {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    position: relative;
}

/* Enhance chart readability with consistent styling */
.chart-container canvas {
    /* Apply consistent styling to all charts */
    filter: brightness(1.1);
}

/* Add text shadow to chart text for better visibility on all backgrounds */
.chart-container {
    /* This creates a subtle shadow effect around text in charts */
    text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.8), 0px 0px 4px rgba(0, 0, 0, 0.5);
}

/* Style for loan summary chart container - keep dark background */
.loan-summary-results .chart-container {
    /* Keep existing dark styling */
    border-radius: 4px;
    padding: 5px;
    margin-top: 15px;
}

/* Style for chart containers in other sections */
.result-section .chart-container,
.first-time-buyer-resources .chart-container {
    /* No dark background, just subtle styling */
    border-radius: 4px;
    padding: 5px;
    margin-top: 15px;
}

/* Force ZERO margins on all result sections first */
#buyer-result > div {
    margin: 0 !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

/* Add a very small consistent gap between adjacent sections */
#buyer-result > div + div {
    margin-top: 2px !important;
}

.result-section h4 {
    color: #00ddeb;
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
    line-height: 1.4;
}

/* More condensed styling for Monthly Costs section - matching Loan Summary */
.monthly-costs-section {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

/* Tighter spacing for crypto, seller, and investor calculator results - matching buyer calculator */
#crypto-result .result-section,
#seller-result .result-section,
#investor-result .result-section {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

/* Ensure good spacing between label and value for all calculators */
#crypto-result .result-row span:first-child,
#seller-result .result-row span:first-child,
#investor-result .result-row span:first-child {
    padding-right: 10px;
    flex: 1;
}

#crypto-result .result-row span:last-child,
#seller-result .result-row span:last-child,
#investor-result .result-row span:last-child {
    text-align: right;
    font-weight: 500;
}

/* Further optimize for mobile */
@media (max-width: 480px) {
    #crypto-result .result-section,
    #seller-result .result-section,
    #investor-result .result-section {
        padding: 5px 8px;
        margin-bottom: 6px;
    }
    
    #crypto-result .result-row,
    #seller-result .result-row,
    #investor-result .result-row {
        margin-bottom: 3px;
        font-size: 0.9em;
    }
    
    #crypto-result h4,
    #seller-result h4,
    #investor-result h4 {
        margin-bottom: 5px;
        font-size: 0.92em;
    }
}

#crypto-result .result-row,
#seller-result .result-row,
#investor-result .result-row {
    margin-bottom: 4px;
    font-size: 0.93em;
}

#crypto-result h4,
#seller-result h4,
#investor-result h4 {
    margin-bottom: 6px;
    font-size: 0.95em;
    font-weight: 600;
}

.monthly-costs-section h4 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

.monthly-costs-section .result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.monthly-costs-section .result-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.monthly-costs-section .result-row span:first-child {
    font-weight: 500;
    padding-right: 8px;
}

.monthly-costs-section .result-row span:last-child {
    font-weight: 600;
    text-align: right;
}

.monthly-costs-section .result-row.total {
    margin-top: 4px;
    padding-top: 3px;
}

.result-row span:first-child {
    color: rgba(255, 255, 255, 0.85);
}

.result-row span:last-child {
    font-weight: 500;
    color: #fff;
}

/* Extra Payment Details Section - Condensed */
.extra-payment-section {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

.extra-payment-section h4 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

.extra-payment-section .result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.extra-payment-section .result-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.extra-payment-section .result-row span:first-child {
    font-weight: 500;
    padding-right: 8px;
}

.extra-payment-section .result-row span:last-child {
    font-weight: 600;
    text-align: right;
}

/* Upfront Costs Section - Condensed */
.upfront-costs-section {
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

.upfront-costs-section h4 {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

.upfront-costs-section .result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.upfront-costs-section .result-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.upfront-costs-section .result-row span:first-child {
    font-weight: 500;
    padding-right: 8px;
}

.upfront-costs-section .result-row span:last-child {
    font-weight: 600;
    text-align: right;
}

.upfront-costs-section .result-row.total {
    margin-top: 4px;
    padding-top: 3px;
}

.result-row.total {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
    font-size: 1.05em;
}

.result-row.total span:last-child {
    color: #00ddeb;
}

.result-row.highlight span:last-child {
    color: #4dff88;
}

.result-row.extra span:last-child {
    color: #ffce3d;
}

.calc-mode p {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #d5e1ef;
    font-size: 1em;
    line-height: 1.6;
    white-space: pre-wrap;
    text-align: left;
}

.calc-mode p .error {
    color: #ff6b6b;
    font-weight: 500;
}

.calc-btn:focus,
.save-btn:focus,
.share-btn:focus,
.tab-label:focus {
    outline: 2px solid #00ddeb;
    outline-offset: 2px;
}

.calc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.save-btn,
.share-btn {
    padding: 12px 24px;
    background: linear-gradient(to right, #00ddeb, #0288d1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 221, 235, 0.3);
    transition: all 0.3s ease;
}

.save-btn:hover,
.share-btn:hover {
    background: linear-gradient(to right, #0288d1, #01579b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 221, 235, 0.4);
}

/* Tesla-inspired explorer link */
.explorer-link {
    color: #00ddeb;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0, 221, 235, 0.1);
    border: 1px solid rgba(0, 221, 235, 0.2);
}

.explorer-link:hover {
    color: #ffffff;
    background: rgba(0, 221, 235, 0.25);
    border-color: rgba(0, 221, 235, 0.4);
    box-shadow: 0 0 12px rgba(0, 221, 235, 0.3);
}

.referral-link {
    color: #00ddeb;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.referral-link:hover {
    color: #0288d1;
    text-decoration: underline;
}

footer {
    margin-top: 48px;
    padding-bottom: 32px;
}

.powered-by {
    color: #b0bec5;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.powered-by:hover {
    color: #d5e1ef;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media only screen and (max-width: 768px) {
    /* Body padding is globally set to 60px 15px 30px 15px */
    .calc-box {
        max-width: 800px;
        width: 100%;
    }
    .container {
        max-width: 100%;
    }
    .calc-tabs {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }
    .tab-label {
        flex: 0 1 auto;
        padding: 10px 16px;
        font-size: 0.95em;
    }
    .calc-card {
        padding: 20px;
    }
    .language-selector {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 60px 15px 30px 15px;
    }
    h1 {
        font-size: 2em;
    }
    p.subtitle {
        font-size: 1.1em;
    }
    .calc-footer {
        flex-direction: column;
        gap: 12px;
    }
    .save-btn, .share-btn, .referral-link {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
    .calc-mode input,
    .calc-mode select {
        font-size: 0.95em;
        padding: 12px;
    }
    .calc-btn {
        font-size: 0.95em;
        padding: 12px;
    }
    .input-group label {
        font-size: 0.9em;
    }
    
    /* Fix for loan summary section on mobile */
    .loan-summary-results {
        background-color: rgba(20, 35, 55, 0.85);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .loan-summary-results .detail-row {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .loan-summary-results .detail-row:last-child {
        border-bottom: none;
    }
    
    .loan-summary-results .detail-row span:first-child {
        color: #ccc;
        font-weight: 500;
    }
    
    .loan-summary-results .detail-row span:last-child {
        font-weight: 600;
        color: white;
        text-align: right;
    }
    
    .loan-summary-results .detail-row.underlined {
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .loan-summary-results .detail-row.total {
        padding-top: 8px;
    }
    
    .loan-summary-results .detail-row.total span:last-child {
        color: #00ddeb;
        font-weight: 700;
    }

}