/* Back-to-top button style */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
}

/* Hero section styling */
.hero {
  background: url("../img/hero-bg.png") center center no-repeat;
  background-size: cover;
  color: white;
  position: absolute; /* Position absolutely */
  top: 0; /* Start from top */
  left: 0;
  right: 0;
  bottom: 0; /* Extend to bottom */
  width: 100%;
  min-height: 100vh; /* Ensure it's at least full viewport height */
  text-align: center;
  padding-top: 60px; /* Account for header height */
  display: block; /* Changed from flex to block */
  z-index: 0; /* Behind the header */
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 6rem 1rem 5rem;
  min-height: calc(100vh - 60px); /* Full height minus header */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Transparent header */
.header-transparent {
  background-color: transparent !important;
}

/* Header adjustments */
.header {
  padding: 0.75rem 1rem !important;
  width: 100%;
}

/* Logo-tabs container in header_controls */
.logo-tabs-container {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin-right: auto; /* Push to left side */
}

/* Navigation tabs styling */
#mainTabs {
  border-bottom: none;
  flex-wrap: nowrap;
  overflow-x: auto; /* Allow horizontal scrolling on small devices */
  -ms-overflow-style: none; /* Hide scrollbar IE and Edge */
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

#mainTabs::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome, Safari and Opera */
}

#mainTabs .nav-link {
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

#mainTabs .nav-link:hover,
#mainTabs .nav-link:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

#mainTabs .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
  border-bottom: 2px solid #ffffff;
}

/* Tab content styling */
.tab-content {
  margin-top: 2rem;
}

.tab-pane h1.display-2 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.tab-pane p.lead {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2rem;
}

/* Pricing Section Styles */
.pricing-section {
  margin-top: 3rem;
}

.pricing-container {
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: hidden;
}

.card {
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 1rem;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
}

.pricing-card-title {
  font-size: 2.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.features {
  overflow-y: auto;
  max-height: 250px;
  padding-right: 0.5rem;
}

/* Customize scrollbar for features */
.features::-webkit-scrollbar {
  width: 6px;
}

.features::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.features::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.features::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Language Switcher with Picker Dropdown */
.lang-picker-container {
  position: relative;
}

.lang-current-flag {
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  margin-left: 0.5rem;
}

.lang-current-flag:hover,
.lang-current-flag:focus {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.lang-current-flag:after {
  display: none;
}

.lang-current-flag .active-flag {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-picker {
  min-width: 150px;
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 0.5rem 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.lang-picker .dropdown-item {
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.lang-picker .dropdown-item:hover,
.lang-picker .dropdown-item:focus {
  background-color: rgba(0, 0, 0, 0.05);
}

.lang-picker .dropdown-item.active {
  background-color: rgba(0, 123, 255, 0.1);
  color: inherit;
  font-weight: 500;
}

.lang-picker .dropdown-item img {
  transition: transform 0.2s ease;
}

.lang-picker .dropdown-item:hover img {
  transform: scale(1.1);
}

/* Improved header container styles */
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.toggle-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Improved responsive button styles */
.auth-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto; /* Push to right side */
}

.auth-buttons .btn {
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  min-width: 90px;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.auth-buttons .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Header layout improvements */
.header .d-flex.align-items-center {
  justify-content: center;
}

.header .d-flex.align-items-center:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive Modal Styles */
.modal-dialog {
  max-width: 90%;
  margin: 1.75rem auto;
}

.modal-content {
  border-radius: 0.75rem;
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body .form-label {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.modal-body .form-control {
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}

.modal-body .btn {
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

.modal-body .small {
  font-size: 0.875rem;
}

/* Media query refinements for consistent header */
@media (max-width: 991.98px) {
  .header .container {
    padding: 0.75rem 1rem;
  }
  
  .auth-buttons .btn {
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    min-width: 85px;
  }
  
  .modal-header {
    padding: 1rem 1.25rem;
  }
  
  .modal-body {
    padding: 1.25rem;
  }
  
  .pricing-card-title {
    font-size: 2rem;
  }
  
  .features {
    max-height: 200px;
  }
  
  .header-controls {
    gap: 0.75rem;
  }
  
  .toggle-controls {
    gap: 0.4rem;
  }
}

@media (max-width: 767.98px) {
  /* Reorganize header for medium-small screens */
  .header .container {
    flex-direction: row; /* Keep the direction as row instead of column for better spacing */
    flex-wrap: wrap; /* Allow wrapping */
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    justify-content: space-between;
  }
  
  .logo-tabs-container {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  
  .header-controls {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .toggle-controls {
    gap: 0.5rem;
  }
  
  .logo {
    margin-right: 0 !important;
  }
  
  #mainTabs {
    width: 100%;
    justify-content: center;
  }
  
  #mainTabs .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }
  
  /* Logo sizing */
  .logo img {
    height: 60px;
    margin-left: 0; /* Reset margin for better mobile layout */
  }
  
  .auth-buttons {
    justify-content: center;
    margin: 0.5rem 0;
  }
  
  /* Modal adjustments */
  .modal-header {
    padding: 0.9rem 1.1rem;
  }
  
  .modal-title {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 1.1rem;
  }
  
  /* Hero adjustments */
  .hero {
    padding-top: 90px; /* Taller header on mobile */
  }
  
  .hero-content {
    padding-top: 3rem;
    min-height: calc(100vh - 90px);
  }
  
  /* Card & pricing adjustments */
  .pricing-card-title {
    font-size: 1.75rem;
  }
  
  .features {
    max-height: 180px;
  }
  
  /* Make cards not too tall on mobile */
  .card {
    max-height: 500px;
  }
  
  /* Allow the hero content to scroll on mobile when content is tall */
  .hero-content {
    padding-bottom: 2rem;
    -webkit-overflow-scrolling: touch; /* Improve smooth scrolling on iOS */
  }
  
  .auto-height-hero {
    padding-top: 90px;
  }
}

@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
  }
}

@media (max-width: 575.98px) {
  .header-controls {
    flex-direction: row; /* Keep as row for better spacing */
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
  }
  
  .auth-buttons, .toggle-controls {
    justify-content: center;
  }
  
  .auth-buttons {
    flex-grow: 1; /* Allow buttons to use available space */
    order: 1; /* Display above toggles on narrow screens */
    margin-bottom: 0.5rem;
  }
  
  .toggle-controls {
    width: 100%;
    justify-content: center;
    order: 2;
  }
  
  .auth-buttons .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    min-width: 70px;
    min-height: 34px;
    flex: 1; /* Allow buttons to share available space equally */
    max-width: 120px; /* Prevent buttons from becoming too wide */
  }
  
  /* Further reduce logo size */
  .logo img {
    height: 50px;
  }
  
  /* Tab adjustments for small screens */
  #mainTabs .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  /* Fixed header for smaller screens */
  .header-transparent {
    background-color: rgba(0, 0, 0, 0.7) !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
  }
  
  
  /* Make hero section content scrollable */
  .hero {
    padding-top: 120px;
  }
  
  .hero-content {
    padding-top: 2rem;
    min-height: calc(100vh - 120px);
  }
  
  .auto-height-hero {
    padding-top: 120px;
  }
  
  .tab-content {
    margin-top: 1rem;
  }
  
  /* Pricing card adjustments */
  .pricing-card-title {
    font-size: 1.5rem;
  }
  
  /* Further limit card height on smallest screens */
  .card {
    max-height: 450px;
  }
  
  /* Make the features section shorter */
  .features {
    max-height: 150px;
  }
  
  /* Adjust buttons on small screens */
  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  .header .container {
    padding: 0.5rem 0.75rem;
  }
  
  .logo-tabs-container {
    gap: 0.25rem;
  }
  
  .toggle-controls {
    transform: scale(0.9);
    transform-origin: center;
  }
  
  .auth-buttons .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    min-width: 65px;
    min-height: 32px;
  }
  
  /* Tab adjustments for very small screens */
  #mainTabs .nav-link {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
  
  /* Adjust hero padding for very small screens */
  .hero {
    padding-top: 9rem;
  }
  
  /* Improve modal usability on small screens */
  .modal-body {
    padding: 1rem;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .auto-height-hero {
    padding-top: 7rem;
  }
  
  .hero-content {
    padding-top: 7rem;
  }
}

@media (max-width: 360px) {
  .toggle-controls {
    transform: scale(0.85);
  }
  
  .auth-buttons {
    gap: 0.25rem;
  }
  
  .auth-buttons .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    min-width: 60px;
    min-height: 30px;
    margin: 0.05rem;
  }
  
  /* Smallest logo */
  .logo img {
    height: 40px;
  }
  
  /* Tiniest tab padding */
  #mainTabs .nav-item {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
  }
  
  /* Further reduce spacing in hero section */
  .hero {
    padding-top: 8rem;
  }
  
  .tab-pane h1.display-2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
  }
  
  .tab-pane p.lead {
    font-size: clamp(0.8rem, 2vw, 1rem);
    margin-bottom: 1.5rem;
  }
  
  /* Force everything to be centered */
  .header .container,
  .header-controls,
  .auth-buttons {
    justify-content: center !important;
    text-align: center;
  }
  
  /* Ensure equal sizing */
  .auth-buttons .btn-outline-light,
  .auth-buttons .btn-light {
    flex: 1;
    max-width: 70px;
  }
  
  .auto-height-hero {
    padding-top: 8rem;
  }
  
  .hero-content {
    padding-top: 8rem;
  }
}

/* Fixed positioning adjustments */
@media (max-height: 700px) and (max-width: 768px) {
  .hero {
    min-height: 120vh; /* Ensure enough height for scrolling on short screens */
  }
  
  .hero-content {
    padding-top: 2rem;
  }
}

/* Specific button styles for consistent dimensions */
.login-btn, .signup-btn {
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
}

@media (max-width: 767.98px) {
  .login-btn, .signup-btn {
    min-width: 80px;
    height: 36px;
  }
}

@media (max-width: 575.98px) {
  .login-btn, .signup-btn {
    min-width: 70px;
    height: 34px;
  }
}

@media (max-width: 420px) {
  .login-btn, .signup-btn {
    min-width: 65px;
    height: 32px;
  }
}

@media (max-width: 360px) {
  .login-btn, .signup-btn {
    min-width: 60px;
    height: 30px;
  }
}

/* Added portrait mode optimization */
@media (max-width: 575.98px) and (orientation: portrait) {
  .hero {
    padding-top: 10rem;
  }
  
  .header .container {
    padding: 0.5rem;
  }
  
  /* Optimize modals for portrait orientation */
  .modal-dialog {
    height: auto;
    max-height: 85vh;
  }
  
  .modal-content {
    max-height: 80vh;
  }
  
  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Auto height hero modifier */
.auto-height-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  padding-top: 60px; /* Account for header height */
}

@media (max-width: 767.98px) {
  .auto-height-hero {
    padding-top: 90px;
  }
  
  .hero-content {
    padding-top: 3rem;
    min-height: calc(100vh - 90px);
  }
}

@media (max-width: 575.98px) {
  .auto-height-hero {
    padding-top: 120px;
  }
  
  .hero-content {
    padding-top: 2rem;
    min-height: calc(100vh - 120px);
  }
}

@media (max-width: 420px) {
  .auto-height-hero {
    padding-top: 7rem;
  }
  
  .hero-content {
    padding-top: 7rem;
  }
}