/* ========================================================
   CABINET D'HÉPATO-GASTRO-ENTÉROLOGIE DR. LAMARTI FERDAOUSS
   Fichier de Styles CSS Principal - Responsive PC, Mobile & TV
   ======================================================== */

:root {
  --color-navy-950: #0a192f;
  --color-navy-900: #0f2744;
  --color-navy-800: #1b3a5f;
  
  --color-teal-900: #134e4a;
  --color-teal-800: #115e59;
  --color-teal-700: #0f766e;
  --color-teal-600: #0d9488;
  --color-teal-500: #14b8a6;
  --color-teal-400: #2dd4bf;
  --color-teal-100: #ccfbf1;
  --color-teal-50: #f0fdfa;

  --color-cyan-700: #0e7490;
  --color-cyan-600: #0891b2;
  --color-cyan-500: #06b6d4;

  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, Cambria, 'Times New Roman', serif;
}

/* Base Resets & Global Smoothness */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-slate-50);
  color: var(--color-slate-800);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Custom Utilities for Navy colors mimicking Tailwind classes */
.bg-navy-950 { background-color: var(--color-navy-950); }
.bg-navy-900 { background-color: var(--color-navy-900); }
.bg-navy-800 { background-color: var(--color-navy-800); }
.border-navy-800 { border-color: rgba(27, 58, 95, 0.7); }
.text-navy-950 { color: var(--color-navy-950); }

/* Typography */
.font-serif {
  font-family: var(--font-serif);
}

.font-sans {
  font-family: var(--font-sans);
}

/* Animations */
@keyframes bounceGentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.animate-bounce-gentle {
  animation: bounceGentle 4s ease-in-out infinite;
}

/* Navigation Links */
.nav-link {
  position: relative;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-teal-600);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-teal-700);
  font-weight: 600;
}

/* Custom Shadow Utility */
.shadow-xs {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Form Styles */
input, select, textarea {
  font-family: inherit;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-teal-600) !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* FAQ Accordion Styling */
.faq-item {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item.active {
  border-color: var(--color-teal-500);
  box-shadow: 0 4px 12px -2px rgba(13, 148, 136, 0.12);
}

.faq-question {
  cursor: pointer;
  user-select: none;
}

.faq-question i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.faq-item.active .faq-answer {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Lightbox Modal */
#imageLightbox {
  backdrop-filter: blur(8px);
  animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Floating Actions */
#scrollTopBtn {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#scrollTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
}

#scrollTopBtn:hover {
  transform: translateY(-4px);
}

/* ========================================================
   MODE TÉLÉVISION / GRAND ÉCRAN (TV MODE)
   Optimisé pour écrans 4K, Smart TV, écrans de salon & conférences
   ======================================================== */

body.tv-mode {
  font-size: 1.15rem;
  line-height: 1.8;
  background-color: #f1f5f9;
}

body.tv-mode header {
  height: 6rem;
}

body.tv-mode h1 {
  font-size: clamp(2.5rem, 4vw, 4.5rem) !important;
  line-height: 1.2 !important;
}

body.tv-mode h2 {
  font-size: clamp(2rem, 3.2vw, 3.5rem) !important;
}

body.tv-mode h3 {
  font-size: clamp(1.5rem, 2.2vw, 2.5rem) !important;
}

body.tv-mode p,
body.tv-mode ul {
  font-size: 1.125rem !important;
}

body.tv-mode .nav-link {
  font-size: 1.2rem;
  padding: 0.6rem 0.2rem;
}

body.tv-mode button,
body.tv-mode a.inline-flex {
  font-size: 1.1rem !important;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

body.tv-mode .tv-toggle-btn {
  background-color: #0d9488 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  font-weight: 700;
}

/* High Resolution TV & 4K Displays Media Query */
@media (min-width: 1920px) {
  .max-w-7xl {
    max-w: 1600px;
    max-width: 1600px;
  }

  body {
    font-size: 1.1rem;
  }
}

/* ========================================================
   RESPONSIVE DESIGN ADAPTATIONS (MOBILE / SMARTPHONE)
   ======================================================== */

@media (max-width: 768px) {
  body {
    padding-bottom: 4.5rem; /* Space for the bottom navigation bar */
  }

  .topbar {
    font-size: 0.75rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  h1 {
    font-size: 2rem !important;
    line-height: 1.25 !important;
  }

  h2 {
    font-size: 1.65rem !important;
    line-height: 1.3 !important;
  }

  .grid {
    gap: 1.25rem !important;
  }
}

/* Print Optimization */
@media print {
  .topbar,
  #mainHeader,
  #scrollTopBtn,
  .tv-toggle-btn,
  .mobile-bottom-bar,
  iframe {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}
