/* ============================================
   STYLE.CSS — Dr. Mohamed Arafa Clinic
   Stack: HTML + TailwindCSS (CDN)
   Author: Senior UI/UX Refactor
   ============================================ */

/* ===== 1. BASE & RESET ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* ===== 2. TYPOGRAPHY / FONTS ===== */
html[dir="rtl"] { font-family: 'Cairo', sans-serif; }
html[dir="ltr"] { font-family: 'Poppins', sans-serif; }

/* ===== 3. CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover { background: #E8651A; }

/* ===== 4. SELECTION ===== */
::selection { background: #E8651A; color: #fff; }

/* ===== 5. FOCUS ACCESSIBILITY ===== */
:focus-visible {
    outline: 2px solid #E8651A;
    outline-offset: 3px;
    border-radius: 4px;
}
a:focus-visible, button:focus-visible { outline: 2px solid #E8651A; }

/* ===== 6. IMAGE DEFAULTS ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

/* ===== 7. SMOOTH IMAGE LOAD ===== */
img[loading="lazy"] { opacity: 0; }
img[loading="lazy"].loaded { opacity: 1; }

/* ===== 8. GLASSMORPHISM ===== */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== 9. FLOATING WHATSAPP BUTTON ===== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: whatsapp-pulse 2.5s ease-in-out infinite;
    will-change: transform;
}
html[dir="rtl"] .whatsapp-float { right: auto; left: 2rem; }

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.55);
}

@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
    50%       { box-shadow: 0 4px 36px rgba(37, 211, 102, 0.65); }
}

/* ===== 10. SCROLL REVEAL SYSTEM ===== */
.reveal,
.reveal-left,
.reveal-right {
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal       { transform: translateY(28px); }
.reveal-left  { transform: translateX(-36px); }
.reveal-right { transform: translateX(36px); }

.reveal.active,
.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translate(0);
}

/* Stagger helpers — use delay-[N] utility or these classes */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== 11. SERVICE CARDS ===== */
.service-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
    will-change: transform;
}
.service-card:hover { transform: translateY(-6px); }

/* Staggered reveal */
.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.12s; }
.service-card:nth-child(3) { transition-delay: 0.19s; }
.service-card:nth-child(4) { transition-delay: 0.26s; }

/* ===== 12. TESTIMONIAL CARDS ===== */
.testimonial-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease;
    will-change: transform;
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.07);
}

/* ===== 13. FORM ===== */
.form-input {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.form-input:focus {
    border-color: #E8651A;
    box-shadow: 0 0 0 3px rgba(232, 101, 26, 0.15);
    background: #fff;
    outline: none;
}

/* ===== 14. SECTION DIVIDER ===== */
.section-divider {
    width: 56px;
    height: 4px;
    background: linear-gradient(90deg, #E8651A, #f59e0b);
    border-radius: 99px;
    position: relative;
}
.section-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 64px;
    width: 10px;
    height: 4px;
    background: #E8651A;
    border-radius: 99px;
    opacity: 0.4;
}
html[dir="rtl"] .section-divider::after { left: auto; right: 64px; }

/* ===== 15. MOBILE MENU ===== */
html[dir="rtl"] #mobile-menu { transform: translateX(-100%); }
html[dir="rtl"] #mobile-menu.open { transform: translateX(0); }
html[dir="ltr"] #mobile-menu { transform: translateX(100%); }
html[dir="ltr"] #mobile-menu.open { transform: translateX(0); }

#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 16. LOGO ===== */
.logo-icon { transition: transform 0.3s ease; }
.logo-icon:hover { transform: scale(1.06); }

/* ===== 17. NAV LINK UNDERLINE EFFECT ===== */
.nav-link {
    position: relative;
    padding-bottom: 2px;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: #E8651A;
    border-radius: 99px;
    transition: width 0.3s ease;
}
html[dir="ltr"] .nav-link::after { left: 0; right: auto; }
.nav-link:hover::after,
.nav-link.active-link::after { width: 100%; }

/* ===== 18. FLOATING ANIMATION ===== */
@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}
.float-anim { animation: float-slow 6s ease-in-out infinite; }

/* ===== 19. COUNTER ANIMATION ===== */
@keyframes count-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== 20. TOAST ANIMATION ===== */
@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 21. BLOG MEDIA ===== */
.media-tab-btn {
    transition: background 0.22s ease, color 0.22s ease;
    border-radius: 8px;
    cursor: pointer;
}
.media-tab-btn.active {
    background: #E8651A;
    color: #fff;
}
.media-panel { display: none; }
.media-panel.active { display: block; }

/* Responsive 16:9 embed */
.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #111;
}
.video-embed-wrap iframe,
.video-embed-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== 22. BLOG ARTICLE TYPOGRAPHY ===== */
.article-prose h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2D2D2D;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.article-prose p { margin-bottom: 1rem; line-height: 1.85; }
.article-prose ul {
    list-style: disc;
    padding-inline-start: 1.5rem;
    margin-bottom: 1rem;
}
.article-prose li { margin-bottom: 0.35rem; }

/* ===== 23. SCROLLBAR HIDE UTILITY ===== */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== 24. RTL ARROW FLIP ===== */
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

/* ===== 25. REDUCE MOTION (Accessibility) ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal-left, .reveal-right {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== 26. PRINT ===== */
@media print {
    .whatsapp-float,
    #navbar,
    #mobile-menu { display: none !important; }
}
