/* ==========================================================
   Dr. Sepideh Niazi — Premium UI Layer
   (Keep Tailwind CDN for layout; this file adds polish)
   ========================================================== */

:root{
  --primary:#1B6D6F;
  --accent:#E67E22;
  --cardiac:#2563EB;
  --bg:#FDF8F3;
  --text:#0f172a;
  --muted:#475569;
  --glass: rgba(255,255,255,.72);
  --glass-border: rgba(255,255,255,.45);
  --shadow: 0 18px 50px rgba(27, 109, 111, 0.15);
  --shadow-soft: 0 10px 30px rgba(2, 6, 23, .06);
  --shadow-lift: 0 18px 42px rgba(27,109,111,.12), 0 12px 22px rgba(2,6,23,.08);
}

html{
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-synthesis: none;
}

body{
  background:
    radial-gradient(900px 500px at 88% 6%, rgba(27,109,111,.14), transparent 62%),
    radial-gradient(700px 420px at 12% 12%, rgba(230,126,34,.14), transparent 58%),
    radial-gradient(900px 520px at 14% 92%, rgba(37,99,235,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0)),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a, button, [role="button"], input, textarea, select{
  -webkit-tap-highlight-color: transparent;
}

::selection{
  background: rgba(230,126,34,.25);
}

/* Typography Enhancements */
h1, h2, h3 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1, h2 { line-height: 1.2; }
h3 { line-height: 1.3; }
p { line-height: 1.7; }
.font-black{ font-weight:800 !important; }
.font-bold{ font-weight:700 !important; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #1B6D6F;
  border-radius: 999px;
  border: 3px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: #164a4c;
}

/* Subtle grain without external assets */
.page-grain{
  pointer-events:none;
  position:fixed;
  inset:0;
  z-index:0;
  opacity:.08;
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0, rgba(0,0,0,.06) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0, rgba(0,0,0,.06) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: soft-light;
}

/* Glass surfaces */
.glass{
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: inherit;
  overflow: hidden;
}
.glass::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0));
  opacity:.7;
  pointer-events:none;
  border-radius: inherit;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .glass{ background: rgba(255,255,255,.9); }
}

/* Enhanced glassmorphism for header */
header .glass {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Premium subtle border */
.premium-border{
  position: relative;
}
.premium-border::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  padding:1px;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.25));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events:none;
}

.section-kicker{
  display:inline-flex;
  gap:.5rem;
  align-items:center;
  padding:.35rem .85rem;
  border-radius: 999px;
  background: rgba(27,109,111,.10);
  border: 1px solid rgba(27,109,111,.22);
  color: var(--primary);
  font-weight: 700;
  font-size: .85rem;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  border-radius: 1rem;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
  will-change: transform;
}
.btn:active{
  transform: translateY(1px) scale(.995);
}
.btn-primary{
  background: var(--accent);
  color:#fff;
  box-shadow: 0 16px 35px rgba(230,126,34,.22);
}
.btn-primary:hover{
  background: #d96f1c;
  box-shadow: 0 18px 42px rgba(230,126,34,.26);
}
.btn-outline{
  border: 2px solid rgba(27,109,111,.85);
  color: var(--primary);
  background: rgba(255,255,255,.35);
}
.btn-outline:hover{
  background: rgba(27,109,111,.10);
  transform: translateY(-2px);
}

@media (hover:hover) and (pointer:fine){
  .btn:hover{ transform: translateY(-2px); }
}

a:focus-visible, button:focus-visible{
  outline: 3px solid rgba(27,109,111,.55);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Skip link */
.skip-link{
  position:absolute;
  top:-110%;
  right:1rem;
  z-index:100000;
  background: var(--primary);
  color:#fff;
  padding:.75rem 1.25rem;
  border-radius: 0 0 1rem 1rem;
  font-weight: 900;
  transition: top .25s ease;
}
.skip-link:focus{ top:0; }

.anchor-offset{ scroll-margin-top: 110px; }
@media (min-width: 768px){ .anchor-offset{ scroll-margin-top: 140px; } }

/* Reveal animation (IntersectionObserver) */
.reveal{
  opacity:0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.reveal-visible{
  opacity:1;
  transform: translateY(0);
}

.card-hover{
  transition: transform .22s ease, box-shadow .22s ease;
}
@media (hover:hover) and (pointer:fine){
  .card-hover:hover{
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
  }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto !important; }
  .reveal{ opacity:1; transform:none; transition:none; }
  .btn{ transition:none; }
  .card-hover{ transition:none; }
  .modal-backdrop, .modal-shell{ transition:none !important; }
}

/* Modal / Sheet */
.modal-backdrop{
  position:fixed;
  inset:0;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1rem;
  background: rgba(2,6,23,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity:0;
  visibility:hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal-backdrop.active{
  opacity:1;
  visibility:visible;
}
.modal-shell{
  width:min(980px, 100%);
  max-height:min(86vh, 820px);
  border-radius: 1.75rem;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.28);
  transform: translateY(16px) scale(.98);
  transition: transform .25s ease;
}
.modal-backdrop.active .modal-shell{
  transform: translateY(0) scale(1);
}
@media (max-width: 768px){
  .modal-shell{
    position:fixed;
    left:0; right:0; bottom:0;
    width:100%;
    max-height: 86vh;
    border-radius: 1.5rem 1.5rem 0 0;
    transform: translateY(100%);
  }
  .modal-backdrop.active .modal-shell{
    transform: translateY(0);
  }
}

.modal-header{
  position:relative;
  padding: 1.4rem 1.5rem 1.25rem;
  color:#fff;
}
.modal-header .close{
  position:absolute;
  left: 1rem;
  top: 1rem;
  width: 44px;
  height: 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  transition: background .18s ease, transform .18s ease;
}
.modal-header .close:hover{
  background: rgba(255,255,255,.30);
  transform: scale(1.06);
}
.modal-body{
  padding: 1.25rem 1.5rem 1.5rem;
  overflow:auto;
  max-height: calc(min(86vh, 820px) - 86px);
}
@media (max-width: 768px){
  .modal-body{ max-height: calc(86vh - 92px); }
}

.modal-text{
  white-space: pre-wrap;
  line-height: 2.05;
  color: #0f172a;
  font-size: 1rem;
}
@media (min-width: 768px){
  .modal-text{ font-size: 1.05rem; }
}

/* Nice scrollbar */
.modal-body::-webkit-scrollbar{ width: 10px; }
.modal-body::-webkit-scrollbar-track{ background: #f1f5f9; }
.modal-body::-webkit-scrollbar-thumb{ background: #cbd5e1; border-radius: 999px; border: 2px solid #f1f5f9; }
.modal-body::-webkit-scrollbar-thumb:hover{ background: #94a3b8; }

/* Bottom bar safe area */
.safe-pb{ padding-bottom: env(safe-area-inset-bottom); }

/* Map skeleton */
.map-skeleton{
  background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.35s infinite;
}
@keyframes shimmer{
  0%{ background-position: -200% 0; }
  100%{ background-position: 200% 0; }
}

/* Footer Contrast Fix (HIGH PRIORITY) */
footer {
  background: linear-gradient(135deg, #1B6D6F 0%, #0f4c4e 100%) !important;
}

/* Override glass effect for footer */
footer .glass {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  overflow:hidden;
}
footer .glass * {
  color: #ffffff !important;
  font-weight: 500 !important;
}
footer .glass i {
  color: #ffffff !important;
}

/* LTR utilities for phone/handles inside RTL pages */
.ltr{ direction:ltr; unicode-bidi: plaintext; }

/* Mobile Hero Section Order */
@media (max-width: 767px) {
  .hero-text-section {
    display: contents;
  }
  .hero-group-top {
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
    width: 100%;
  }
  
  /* Combined Title for Mobile */
  .hero-combined-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    width: 100%;
    font-size: clamp(0.85rem, 3.8vw, 1.35rem); /* Responsive single-line size */
    line-height: 1.2;
  }
  .hero-name-part, .hero-specialty-part {
    display: inline;
    font-size: inherit;
    margin: 0;
  }

  .hero-image-section {
    order: 2;
    margin-bottom: 0.25rem;
  }
  .hero-group-bottom {
    order: 3;
  }
  
  /* Responsive Title Sizing for Mobile */
  .hero-title-text {
    display: inline-block;
    /* white-space: nowrap; Removed to allow wrapping for long text */
    font-size: clamp(1rem, 4vw, 1.5rem); /* Adjusted size for longer text */
    width: 100%;
    text-align: center;
    line-height: 1.6;
  }
}
