/* ==============================================
   Eversmile Dental - Custom Styles
   Minimal Medical Design with Mint Primary Color
   ============================================== */

/* CSS Custom Properties */
:root {
  --primary: #4ECDC4;
  --primary-dark: #3DBDB5;
  --primary-light: #7EDDD7;
  --charcoal: #1F2937;
  --charcoal-light: #374151;
  --bg-white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --radius-card: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background-color: var(--primary);
  color: white;
}

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

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Hide scrollbar for horizontal scroll containers */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Focus States */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Image Optimization */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Link Styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Button Reset */
button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* Input Reset */
input,
select,
textarea {
  font-family: inherit;
}

/* ========================================
   Component Styles
   ======================================== */

/* Navigation */
nav {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

nav.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

/* Mobile Menu Animation */
#mobile-menu {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobile-menu.active {
  max-height: 400px;
  opacity: 1;
}

#mobile-menu:not(.hidden) {
  display: block;
  max-height: 400px;
  opacity: 1;
}

/* Hero Section */
.hero-gradient {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.05) 0%, white 50%, rgba(78, 205, 196, 0.1) 100%);
}

/* Cards */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

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

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

/* Icon Circles */
.icon-circle {
  width: 4rem;
  height: 4rem;
  background-color: rgba(78, 205, 196, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.icon-circle:hover,
.group:hover .icon-circle {
  background-color: var(--primary);
  transform: scale(1.1);
}

.icon-circle i {
  color: var(--primary);
  transition: color 0.3s ease;
}

.icon-circle:hover i,
.group:hover .icon-circle i {
  color: white;
}

/* Doctor Cards */
.doctor-card {
  background: white;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doctor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.doctor-card img {
  transition: transform 0.5s ease;
}

.doctor-card:hover img {
  transform: scale(1.05);
}

/* Review Cards */
.review-card {
  background: white;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.3s ease;
}

.review-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Service Cards */
.service-card {
  background: white;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.service-card:hover h3 {
  color: var(--primary);
}

/* Gallery Items */
.gallery-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Gallery Filter Buttons */
.gallery-filter {
  transition: all 0.3s ease;
}

.gallery-filter.active {
  background-color: var(--primary);
  color: white;
}

/* FAQ Accordion */
.faq-toggle {
  transition: color 0.3s ease;
}

.faq-toggle:hover {
  color: var(--primary);
}

.faq-toggle i {
  transition: transform 0.3s ease;
}

.faq-toggle.active i {
  transform: rotate(180deg);
}

.faq-content {
  transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.3s ease-out;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

.faq-content.active {
  max-height: 500px;
  padding-bottom: 1.25rem;
  opacity: 1;
}

.faq-content:not(.hidden) {
  display: block;
  max-height: 500px;
  padding-bottom: 1.25rem;
  opacity: 1;
}

/* Form Styles */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--charcoal-light);
  opacity: 0.5;
}

/* Checkbox Custom Style */
input[type="checkbox"] {
  accent-color: var(--primary);
}

/* ========================================
   Animation Styles
   ======================================== */

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Pulse Animation for CTA */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-pulse-slow {
  animation: pulse 2s ease-in-out infinite;
}

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Spin Animation for Loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========================================
   Responsive Utilities
   ======================================== */

/* Mobile-first responsive text */
.text-responsive {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.heading-responsive {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

/* Container */
.container-custom {
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-custom {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-custom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ========================================
   Loading States
   ======================================== */

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Button Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid white;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 0.75s linear infinite;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  nav,
  footer,
  .fixed {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: black;
    background: white;
  }

  a {
    text-decoration: underline;
  }

  .shadow-sm,
  .shadow-md,
  .shadow-lg,
  .shadow-xl {
    box-shadow: none;
  }
}

/* ========================================
   Accessibility
   ======================================== */

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 9999;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --primary: #008B8B;
    --primary-dark: #006666;
  }

  .btn-primary,
  .btn-outline:hover {
    border: 2px solid currentColor;
  }
}

/* ========================================
   Dark Mode Support (Future)
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here */
  /* Currently disabled for medical site */
}

/* ========================================
   Specific Component Overrides
   ======================================== */

/* Timeline */
.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary);
}

/* Price Cards */
.price-card {
  position: relative;
  overflow: hidden;
}

.price-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

/* Floating Button Shadow */
.floating-btn {
  box-shadow: 0 4px 20px rgba(78, 205, 196, 0.4);
}

.floating-btn:hover {
  box-shadow: 0 6px 25px rgba(78, 205, 196, 0.5);
}

/* Map Container */
.map-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Video Play Button */
.video-play-btn {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.group:hover .video-play-btn {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
}

/* Gradient Overlays */
.gradient-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-primary {
  background-color: rgba(78, 205, 196, 0.1);
  color: var(--primary);
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22C55E;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gray-200), transparent);
  margin: 2rem 0;
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass Effect */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  width: 1rem;
  height: 1rem;
  background: #EF4444;
  color: white;
  font-size: 0.625rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
