/* Font Imports */
@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-Regular.otf') format('opentype'),
       url('../fonts/Raleway-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-SemiBold.otf') format('opentype'),
       url('../fonts/Raleway-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Regular.otf') format('opentype'),
       url('../fonts/Poppins-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PlayfairDisplay';
  src: url('../fonts/PlayfairDisplay-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'TheArtistScript';
  src: url('fonts/TheArtistScript.otf') format('opentype'),
       url('fonts/MADE TheArtist Script.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GlacialIndifference';
  src: url('../fonts/GlacialIndifference-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Global Styles */
body {
  font-family: 'Raleway', Arial, sans-serif;
  background-color: #faf6ed;
  margin: 0;
  padding: 20px;
  color: #333;
}

/* Main Container: Two-Column Layout, Centered */
.main-container {
  display: flex;
  align-items: stretch;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Left Column: Fixed width for Quote Generator */
.left-column {
  flex: 0 0 600px;
}

/* Right Column: Fills remaining space and matches left column height */
.right-column {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Featured Image: Always show most of the image */
.right-column img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Header - improved alignment */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center; /* This centers items vertically */
  margin-bottom: 30px;
  position: relative;
  flex-wrap: nowrap;
}

/* Title container alignment adjustments */
.title-container {
  display: flex;
  align-items: center; /* Center vertically */
  justify-content: flex-start;
  position: relative;
  margin-bottom: 0;
  width: auto;
  flex: 1;
}

/* Header logo styling with vertical alignment */
.header-logo {
  width: auto;
  max-width: 350px;
  height: auto;
  display: block;
  /* Removed vertical-align as it is not applicable to block elements */
  margin-top: 0; /* Adjust this value to manually offset the logo up/down */
  /* Uncomment and adjust to manually shift the logo: */
  /* transform: translateY(-2px); */
}

/* Language Switch - vertically aligned */
.language-switch {
  display: flex;
  flex-direction: row;
  gap: 5px;
  margin-left: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  align-items: center; /* Center buttons vertically */
  /* Uncomment and adjust to manually shift the buttons: */
  /* margin-top: 0px; */
  /* Control vertical positioning of language buttons */
  transform: translateY(-7px); /* Adjust this value to move buttons up/down */
  position: relative; /* Enable positioning */
  top: -7px; /* Alternative way to adjust vertical position */
}

.language-switch .lang-btn {
  background: transparent;
  border: 1px solid #d9cbb0;
  padding: 4px 8px;
  margin-left: 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: #a39070;
  font-size: 12px;
  opacity: 0.7;
  /* Individual button adjustments if needed */
  position: relative;
  top: -7px; /* Fine-tune individual button position */
}

.language-switch .lang-btn:hover {
  background: #f0e8d9;
  opacity: 0.9;
}

/* Style for active language button - more subtle */
.language-switch .lang-btn.active {
  background-color: #f0e8d9;
  color: #8c7a5e !important;
  border-color: #d9cbb0;
  font-weight: 600;
  opacity: 1;
}

/* Language Switch - ensure it stays next to the logo */
.language-switch {
  display: flex;
  flex-direction: row;
  gap: 5px;
  margin-left: 10px;
  white-space: nowrap; /* Prevent wrapping */
  flex-shrink: 0; /* Don't shrink */
}

/* Quote Generator Container */
#quote-generator {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

/* Button Groups */
.button-group {
  display: flex;
  gap: 10px;
}

/* Toggle Buttons */
.toggle-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid #d9cbb0;
  border-radius: 10px;
  background-color: #f0e8d9;
  cursor: pointer;
  transition: transform 0.6s, padding 0.6s, background-color 0.3s, border-color 0.3s;
  font-size: 14px;
  position: relative;
  overflow: hidden;
  font-family: 'Raleway', Arial, sans-serif;
  font-weight: 600;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  text-align: center;
}
.toggle-btn:hover {
  background-color: #e8dcc5;
}
.toggle-btn.expanded {
  transform: scaleY(1.1);
}
.toggle-btn .btn-text {
  display: block;
}
.toggle-btn .btn-desc {
  display: block;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.6s, max-height 0.6s;
  font-size: 12px;
  margin-top: 5px;
}
.toggle-btn.expanded .btn-desc {
  opacity: 1;
  max-height: 50px;
}
/* Selected state */
.toggle-btn.selected {
  background-color: #a39070;
  color: #fff !important;
  border-color: #8c7a5e;
}
/* Disabled state for addon buttons */
.toggle-btn:disabled,
.toggle-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #e8e4db;
  border-color: #d0c8b8;
  color: #999;
}
.toggle-btn.disabled.selected {
  background-color: #b5a990;
  border-color: #9e917a;
}

/* Slider container */
.slider-container {
  position: relative;
  margin-bottom: 45px;
  padding: 20px 0;
  width: 90%; /* Added to reduce the slider width */
  margin-left: auto; /* Center the slider container */
  margin-right: auto; /* Center the slider container */
}

/* Remove hours display */
#hoursDisplay {
  display: none;
}

/* Detailed Description Container - improved for animations */
#serviceDescription {
  white-space: pre-wrap;
  overflow: hidden;
  padding: 10px;
  font-family: 'GlacialIndifference', 'Raleway', Arial, sans-serif;
  font-size: 16px; /* Increased from 16px to 18px (+2px) */
  text-align: left;
  background-color: transparent;
  border: 1px solid transparent;
  height: auto;
  min-height: 0;
  color: #615b53;
  font-variant-numeric: lining-nums;
  font-feature-settings: 'lnum';
  line-height: 1.5;
  will-change: opacity, height, transform; /* Performance hint for browsers */
  backface-visibility: hidden; /* Helps with text rendering during animations */
  transform: translateZ(0); /* Force GPU acceleration for smoother animations */
  transform-style: preserve-3d; /* Helps with smoother animations */
}

/* Add styling for individual paragraphs within the description */
.desc-paragraph {
  margin-bottom: 16px;
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.desc-paragraph:last-child {
  margin-bottom: 0;
}

/* Emphasized numbers in service descriptions - improved for animations */
.highlight-number {
  font-size: inherit;
  font-weight: 700;
  color: #8c7a5e;
  display: inline-block;
  font-family: inherit;
  transform-origin: center;
  will-change: transform, color, text-shadow, opacity;
  padding: 0 2px;
  border-radius: 3px;
  position: relative;
  z-index: 2;
  vertical-align: baseline;
  line-height: inherit;
  backface-visibility: hidden; /* Reduces text flicker during animations */
  transform: translateZ(0); /* Helps with performance */
}

/* Live Quote Price Display - modified for fixed positioning with rounded corners and margins */
#liveQuote {
  font-size: 20px;
  font-weight: 600;
  font-family: 'Poppins', Arial, sans-serif;
  color: #615b53;
  position: fixed; 
  bottom: 15px; /* Add space from bottom */
  left: 15px; /* Add space from left */
  right: 15px; /* Add space from right */
  max-width: 600px; /* Limit width for larger screens */
  margin: 0 auto; /* Center horizontally */
  background-color: rgba(255, 255, 255, 0.95);
  padding: 12px 20px;
  text-align: center;
  border: 1px solid #e8dcc5; /* Add border all around */
  border-radius: 10px; /* Add rounded corners */
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  transition: background-color 0.3s, transform 0.3s;
}

#liveQuote strong {
  font-size: 28px;
  font-weight: normal;
  color: #8c7a5e;
  display: inline-block;
  transform-origin: center;
  will-change: transform, color, text-shadow;
  position: relative;
  z-index: 2;
}

/* Center the price box on desktop */
@media (min-width: 630px) {
  #liveQuote {
    left: 0;
    right: 0;
  }
}

/* Add padding to the bottom of the form to prevent content from being hidden behind fixed quote */
#quoteForm {
  padding-bottom: 70px; /* Adjust based on the height of the fixed quote box */
}

/* Extra rule for larger Engagement description on the button */
.addon-btn[data-addon="engagement"].expanded .btn-desc {
  max-height: 100px;
}

/* noUiSlider Styling */
.noUi-target {
  height: 14px;
  border-radius: 7px;
  background: #e8dcc5;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.noUi-connects {
  border-radius: 7px;
  z-index: 1;
}

.noUi-connect {
  background: #a39070;
}

/* Make the handle appear on top of everything with a higher z-index and fully cover markers */
.noUi-handle {
  width: 28px !important; /* Increased from 24px to 28px to better cover markers */
  height: 28px !important; /* Increased from 24px to 28px to better cover markers */
  border-radius: 50%;
  background: #a39070;
  border: 2px solid #8c7a5e;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  right: -14px !important; /* Adjusted for new width */
  top: -7px !important; /* Adjusted for new height */
  z-index: 20 !important;
}

.noUi-handle:before, 
.noUi-handle:after {
  display: none;
}

/* Fix for marker positioning - making them higher but with lower z-index */
.noUi-marker-horizontal.noUi-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid #a39070;
  margin-left: -8px;
  position: absolute;
  top: -15px; /* Reverted from -40px back to -15px */
  z-index: 3;
  box-sizing: border-box;
  pointer-events: none;
}

/* Add this rule to completely hide markers when slider handle is over them */
.noUi-origin.noUi-active ~ .noUi-pips .noUi-marker {
  opacity: 0;
  transition: opacity 0.2s;
}

/* Adjust the pip values (hour labels) positioning to be closer to the slider */
.noUi-value {
  font-size: 16px; /* Increased from 14px to 16px (+2px) */
  color: #8c7a5e;
  font-weight: 600;
  font-family: 'Raleway', Arial, sans-serif;
  top: 4px; /* Increased from 2px to 4px to lower by 2px */
  font-variant-numeric: lining-nums;
  font-feature-settings: 'lnum';
  letter-spacing: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .main-container {
    flex-direction: column;
  }
  
  .left-column {
    flex: 1 0 auto;
    width: 100%;
  }
  
  .right-column {
    display: none;
  }
  
  #quote-generator {
    padding: 15px 10px;
  }
  
  .button-group {
    gap: 5px;
  }
  
  .toggle-btn {
    padding: 8px 5px;
    font-size: 13px;
    border-radius: 8px;
  }
  
  #serviceDescription {
    font-size: 16px; /* Increased from 14px to 16px (+2px) */
  }
  
  #liveQuote {
    font-size: 16px;
    padding: 10px 15px;
    bottom: 10px; /* Slightly less space on mobile */
    left: 10px;
    right: 10px;
    max-width: none; /* Full width on mobile */
    border-radius: 8px; /* Slightly smaller radius on mobile */
  }
  
  #liveQuote strong {
    font-size: 22px; /* Slightly smaller font on mobile */
  }
  
  /* Additional padding at the bottom for mobile */
  #quoteForm {
    padding-bottom: 60px;
  }
  
  #liveQuote {
    font-size: 16px;
  }
  
  .header-title-part {
    font-size: 22px;
  }
  
  .script-background {
    font-size: 22px; /* Increased from 16.5px to 22px for better visibility */
    top: 12px; /* Changed from 8px to 12px to move it lower on mobile */
    left: 50%; /* Adjusted to 50% for proper centering */
    letter-spacing: 1.5px; /* Slightly reduced letter spacing for mobile */
  }
  
  .title-icon {
    height: 22px;
    margin: 0 5px;
    vertical-align: middle; /* Changed to match desktop */
    transform: translateY(-2px); /* Slight adjustment for mobile */
  }
  
  .noUi-handle {
    width: 32px !important; /* Increased from 28px to 32px for mobile to better cover markers */
    height: 32px !important; /* Increased from 28px to 32px for mobile to better cover markers */
    right: -16px !important; /* Adjusted for new width */
    top: -9px !important; /* Adjusted for new height */
    z-index: 20 !important; /* Ensure consistent z-index in mobile view */
  }
  
  /* Improve marker positioning on mobile */
  .noUi-marker-horizontal.noUi-marker {
    width: 18px;
    height: 18px;
    margin-left: -9px;
    top: -16px; /* Reverted from -40px back to -16px */
  }
  
  /* Adjust the pip values positioning to be closer to the slider on mobile */
  .noUi-value {
    font-size: 15px; /* Increased from 13px to 15px (+2px) */
    top: 6px; /* Increased from 4px to 6px to lower by 2px */
  }
  
  /* Make slider slightly narrower on mobile to avoid touch edge issues */
  .slider-container {
    width: 85%;
  }
  
  .language-switch {
    display: flex;
    gap: 5px;
    flex-direction: row;
    margin-left: 5px;
    transform: translateY(10px); /* Mobile-specific adjustment */
    top: -10px; /* Alternative mobile adjustment */
  }
  
  .lang-btn {
    padding: 3px 6px;
    font-size: 11px;
    margin-left: 0;
    opacity: 0.7;
  }
  
  .addon-btn.expanded .btn-desc {
    max-height: 100px;
    font-size: 11px;
    line-height: 1.3;
    padding: 5px 0;
  }

  /* Improve header layout on mobile to keep language switch next to logo */
  .header {
    flex-direction: row; /* Changed from column to row */
    align-items: center; /* Center align items */
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px; /* Added more space below header on mobile */
  }
  
  /* Center the title container on mobile */
  .title-container {
    align-self: center;
    margin-bottom: 0;
    justify-content: flex-start;
  }
  
  /* Keep language switcher next to logo on mobile */
  .language-switch {
    display: flex;
    gap: 5px;
    flex-direction: row;
    margin-left: 5px;
    align-self: center;
  }

  .header-logo {
    max-width: 220px; /* Further reduced on mobile */
  }
}

/* Support for medium-sized tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .left-column {
    flex: 0 0 450px;
  }
  
  .button-group {
    gap: 8px;
  }
}
