/* StudyHop Custom Styles */

/* Color Scheme Variables */
:root {
  --ocean-blue-50: #eff6ff;
  --ocean-blue-100: #dbeafe;
  --ocean-blue-200: #bfdbfe;
  --ocean-blue-300: #93c5fd;
  --ocean-blue-400: #60a5fa;
  --ocean-blue-500: #3b82f6;
  --ocean-blue-600: #2563eb;
  --ocean-blue-700: #1d4ed8;
  --ocean-blue-800: #1e40af;
  --ocean-blue-900: #1e3a8a;

  /* Gradient Variables */
  --gradient-primary: linear-gradient(
    135deg,
    var(--ocean-blue-500),
    var(--ocean-blue-700)
  );
  --gradient-secondary: linear-gradient(
    135deg,
    var(--ocean-blue-600),
    var(--ocean-blue-800)
  );
  --gradient-hero: linear-gradient(
    135deg,
    var(--ocean-blue-500),
    var(--ocean-blue-700),
    #6366f1
  );
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: #374151;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom button styles */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--gradient-secondary);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--ocean-blue-600);
  border: 2px solid var(--ocean-blue-600);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--ocean-blue-600);
  color: white;
  transform: translateY(-1px);
}

/* Gradient backgrounds */
.bg-gradient-hero {
  background: var(--gradient-hero);
}

.bg-gradient-primary {
  background: var(--gradient-primary);
}

/* Card styles */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #f3f4f6;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.card-teacher {
  padding: 1.5rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #f3f4f6;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-teacher:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--ocean-blue-200);
}

/* Profile image styles */
.profile-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ocean-blue-100);
}

.profile-img-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Rating stars */
.rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.star {
  width: 1rem;
  height: 1rem;
  color: #fbbf24;
}

.star-empty {
  color: #d1d5db;
}

/* Hero section styles */
.hero-gradient {
  background: linear-gradient(
    135deg,
    var(--ocean-blue-500) 0%,
    var(--ocean-blue-700) 50%,
    #6366f1 100%
  );
  position: relative;
  overflow: visible;
}

.hero-gradient::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}

/* Search box styles */
.search-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1000;
}

/* Hero section dropdown specific styles */
.hero-gradient .search-container .dropdown {
  position: relative;
  z-index: 1001;
}

.hero-gradient .search-container .dropdown-content {
  position: absolute;
  z-index: 10001;
  background-color: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  border: 1px solid #e5e7eb;
}

/* Header search dropdown specific styles */
.header .dropdown {
  position: relative;
  z-index: 100;
}

.header .dropdown-content {
  position: absolute;
  z-index: 10000;
  background-color: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-top: 4px;
}

/* Ensure header dropdowns appear above other content */
header .dropdown .dropdown-content {
  position: absolute;
  z-index: 50;
  background-color: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-top: 4px;
  min-width: 180px;
}

/* Header search input styling to match hero section */
header .dropdown input[type="text"] {
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

header .dropdown input[type="text"]:focus {
  border-color: var(--ocean-blue-500);
  ring: 2px;
  ring-color: var(--ocean-blue-500);
  ring-opacity: 0.5;
}

/* Mobile header search styling */
@media (max-width: 768px) {
  #mobile-menu .dropdown-content {
    position: relative;
    margin-top: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
  }
}

/* Filter section styles */
.filter-section {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
  z-index: 40;
  transition: box-shadow 0.2s ease;
}

.filter-section:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Filter controls container */
.filter-section .flex.items-center.space-x-4 {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  overflow-y: visible !important;
}

.filter-section .flex.items-center.space-x-4::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Ensure filter dropdowns are always visible */
.filter-section .dropdown {
  display: block !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

.filter-section .dropdown button {
  display: flex !important;
  align-items: center !important;
  white-space: nowrap !important;
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: block;
}

/* Search input specific styles for dropdowns */
.dropdown input[type="text"] {
  padding-right: 2.5rem; /* Make space for the arrow */
  color: #374151;
  font-weight: 500;
}

.dropdown input[type="text"]:placeholder-shown {
  color: #9ca3af;
  font-weight: 400;
}

.dropdown input[type="text"]:focus {
  color: #374151;
  font-weight: 500;
}

/* For directory page filter dropdowns - override width and positioning */
.filter-section .dropdown {
  width: auto;
  position: relative;
  z-index: 50;
}

/* Override dropdown content for filter section with higher specificity */
.filter-section .dropdown .dropdown-content {
  display: none;
  position: fixed !important; /* Use fixed positioning to escape stacking context */
  z-index: 99999 !important; /* Much higher z-index */
  min-width: 200px;
  max-width: 300px;
  width: max-content;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  margin-top: 0;
  overflow-y: auto;
  max-height: 200px;
}

/* Show dropdown when active and position it correctly */
.filter-section .dropdown.active .dropdown-content {
  display: block !important;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  min-width: 100%;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  z-index: 10000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

/* Ensure dropdowns stay within viewport on mobile */
@media (max-width: 640px) {
  .dropdown-content {
    max-height: 150px;
    left: 0;
    right: 0;
    width: 100%;
  }
}

.dropdown.active .dropdown-content {
  display: block;
  animation: dropdown-appear 0.2s ease-out;
}

.dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
}

/* Hide dropdown items that don't match search */
.dropdown-item.hidden {
  display: none !important;
}

/* No results message styling */
.dropdown-no-results {
  color: #6b7280;
  padding: 0.75rem 1rem;
  text-align: center;
  font-style: italic;
  font-size: 0.9rem;
}

.dropdown-item {
  color: #374151;
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.9rem;
}

.dropdown-item:hover,
.dropdown-item.focused {
  background-color: var(--ocean-blue-50);
  color: var(--ocean-blue-700);
}

.dropdown-item:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

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

/* Stats section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 4rem 0;
}

.stat-item {
  text-align: center;
  padding: 2rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--ocean-blue-600);
  display: block;
}

.stat-label {
  font-size: 1.1rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Testimonial styles */
.testimonial {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--ocean-blue-500);
}

/* Feature grid styles */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 4rem 0;
}

.feature-item {
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  background: var(--gradient-primary);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.5rem;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .search-container {
    padding: 1.25rem;
    margin: 0 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-img-large {
    width: 100px;
    height: 100px;
  }

  .dropdown-content {
    max-height: 150px;
  }
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Sticky sidebar */
.sticky-sidebar {
  position: sticky;
  top: 5rem;
  height: fit-content;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--ocean-blue-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ocean-blue-500);
}

/* Form input styles for educator landing page */
input[type="text"],
input[type="email"],
input[type="tel"] {
  background-color: white;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.2s ease;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  border-color: var(--ocean-blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: white;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover {
  border-color: #9ca3af;
}

/* Ensure form inputs are not disabled or readonly */
input[type="text"]:not([disabled]):not([readonly]),
input[type="email"]:not([disabled]):not([readonly]),
input[type="tel"]:not([disabled]):not([readonly]) {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* Fix any potential z-index issues */
.bg-white.rounded-2xl form {
  position: relative;
  z-index: 1;
}

.bg-white.rounded-2xl form input {
  position: relative;
  z-index: 2;
}
