/* ============================================
   Кабинет охраны зрения - Modern Design 2024
   Glassmorphism + Teal/Mint Theme
   Mobile-first approach
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Color Palette - Teal/Mint */
  --primary: #0d9488;
  --primary-light: #14b8a6;
  --primary-dark: #0f766e;
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;
  
  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-dark: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-blur: 12px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.7;
  
  /* Spacing */
  --section-padding: 6rem;
  --section-padding-mobile: 3.5rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ---------- Base Styles ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--gray-600);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--gray-800);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ---------- Utility Classes ---------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.section {
  padding: var(--section-padding) 0;
}

@media (max-width: 767.98px) {
  .section {
    padding: var(--section-padding-mobile) 0;
  }
}

.section-title {
  text-align: center;
  margin-bottom: 0.75rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  margin: 1rem auto 0;
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
  color: var(--white);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* ---------- Header / Navbar ---------- */
header {
  position: relative;
  z-index: 1000;
}

.navbar {
  padding: 1rem 0;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.navbar.scrolled {
  background: var(--glass-bg-dark);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--gray-800) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1.1rem;
}

.navbar-nav .nav-link {
  color: var(--gray-600) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-50);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.navbar-toggler:focus {
  box-shadow: none;
  background: var(--gray-100);
}

/* Mobile menu */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    box-shadow: var(--glass-shadow);
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
  }
}

/* ---------- Hero / Slider ---------- */
.home-slider {
  position: relative;
  z-index: 1;
}

.slider-item {
  position: relative;
  height: 100vh;
  min-height: 600px;
  max-height: 900px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}

@media (max-width: 767.98px) {
  .slider-item {
    min-height: 100vh;
    max-height: none;
  }
}

.slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.7) 0%,
    rgba(13, 148, 136, 0.4) 100%
  );
}

.slider-text {
  position: relative;
  z-index: 2;
  min-height: inherit;
  padding: 6rem 0 3rem;
}

.hero-content {
  padding: 2.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@media (max-width: 767.98px) {
  .hero-content {
    padding: 1.5rem;
    margin: 0 -0.5rem;
  }
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-content .lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}

/* Owl Carousel Customization */
.owl-carousel .owl-item {
  opacity: 1;
}

.owl-carousel .owl-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.owl-carousel .owl-nav button {
  pointer-events: auto;
  width: 50px;
  height: 50px;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(8px);
  border-radius: 50%;
  color: var(--gray-800) !important;
  font-size: 1.25rem;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.owl-carousel .owl-nav button:hover {
  background: var(--white) !important;
  transform: scale(1.1);
}

.owl-carousel .owl-dots {
  position: absolute;
  bottom: 2rem;
  width: 100%;
  text-align: center;
}

.owl-carousel .owl-dots .owl-dot {
  width: 12px;
  height: 12px;
  margin: 0 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.owl-carousel .owl-dots .owl-dot.active {
  background: var(--white);
  transform: scale(1.2);
}

@media (max-width: 767.98px) {
  .owl-carousel .owl-nav {
    display: none;
  }
}

/* ---------- Features Section ---------- */
.features-section {
  margin-top: -100px;
  position: relative;
  z-index: 10;
  padding-bottom: var(--section-padding-mobile);
}

@media (max-width: 991.98px) {
  .features-section {
    margin-top: -60px;
  }
}

.feature-card {
  padding: 2rem;
  height: 100%;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.feature-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--gray-500);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.feature-contacts {
  margin-top: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.contact-link:hover {
  background: var(--primary-100);
  color: var(--primary-dark);
}

/* На десктопе tel-ссылки не кликабельны */
@media (min-width: 992px) {
  .tel-link {
    pointer-events: none;
    cursor: default;
  }
}

.license-text {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
}

.schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.schedule-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.95rem;
}

.schedule-list li:last-child {
  border-bottom: none;
}

/* ---------- Services Section ---------- */
.services-section {
  background: var(--white);
}

.services-nav {
  gap: 0.5rem;
}

.services-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--gray-600);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.services-nav .nav-link i {
  font-size: 1.25rem;
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.services-nav .nav-link:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.services-nav .nav-link:hover i {
  color: var(--primary);
}

.services-nav .nav-link.active {
  background: var(--glass-bg);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.15);
}

.services-nav .nav-link.active i {
  color: var(--primary);
}

@media (max-width: 991.98px) {
  .services-nav {
    flex-direction: row !important;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    gap: 0.5rem;
  }
  
  .services-nav .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .services-nav .nav-link span {
    display: none;
  }
  
  .services-nav .nav-link i {
    margin: 0;
    font-size: 1.5rem;
  }
}

.service-card {
  padding: 2rem;
  height: 100%;
}

.service-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.service-card p {
  color: var(--gray-600);
}

.info-banner {
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-50) 0%, rgba(255, 255, 255, 0.8) 100%);
  border-left: 4px solid var(--primary);
}

.info-banner h4 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.info-banner p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

/* ---------- Doctors Section ---------- */
.doctors-section {
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.doctor-card {
  padding: 2.5rem;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.doctor-avatar {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--primary);
  border: 4px solid var(--white);
  box-shadow: 0 8px 30px rgba(13, 148, 136, 0.2);
}

.doctor-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.doctor-info h3 {
  margin-bottom: 0.5rem;
}

.doctor-role {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.doctor-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--gray-200);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--section-padding) 0 2rem;
}

@media (max-width: 767.98px) {
  .site-footer {
    padding: var(--section-padding-mobile) 0 2rem;
  }
}

.footer-brand h4 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.footer-brand h4 i {
  color: var(--primary-light);
}

.footer-brand p {
  margin-bottom: 0.5rem;
}

.footer-brand .license {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.site-footer h5 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-schedule,
.footer-contacts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-schedule li,
.footer-contacts li {
  padding: 0.25rem 0;
  font-size: 0.95rem;
}

.footer-contacts a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-fast);
}

.footer-contacts a:hover {
  color: var(--primary-light);
}

.site-footer address {
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.6;
}

.map-container {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.footer-bottom {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--white);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  .feature-card,
  .service-card,
  .doctor-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
  }
  
  .feature-card:nth-child(1) { animation-delay: 0.1s; }
  .feature-card:nth-child(2) { animation-delay: 0.2s; }
  .feature-card:nth-child(3) { animation-delay: 0.3s; }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

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