@import 'tailwindcss';

/* ═══════════════════════════════════════════════════════════════
   CLEAN & PROFESSIONAL — Public Academy Website Template
   Light, minimal, structured. Ready out of the box.
   ═══════════════════════════════════════════════════════════════ */

@theme {
    --color-website-primary: var(--site-primary, #1e3a5f);
    --color-website-secondary: var(--site-secondary, #2d5a87);
    --color-website-accent: var(--site-accent, #2563eb);
    --color-website-text: var(--site-text, #1f2937);
    --color-website-muted: #6b7280;
    --color-website-surface: #ffffff;
    --color-website-surface-raised: #f9fafb;
    --color-website-border: #e5e7eb;
}

@layer base {
    .website-body {
        background: var(--site-bg, #ffffff);
        color: var(--site-text, #1f2937);
        font-family: var(--site-body-font, 'Cairo'), 'Noto Sans Arabic', system-ui, sans-serif;
        direction: rtl;
        min-height: 100vh;
        overflow-x: hidden;
        scroll-behavior: smooth;
        -webkit-font-smoothing: antialiased;
    }

    .website-body * {
        scroll-margin-top: 80px;
    }
}

@layer components {
    /* ─── Navbar ─── */
    .site-nav {
        position: fixed;
        top: 0;
        inset-inline: 0;
        z-index: 100;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--site-primary, #1e3a5f);
    }

    .site-nav--scrolled {
        background: var(--site-primary, #1e3a5f);
        box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    }

    .site-nav--solid {
        background: var(--site-primary, #1e3a5f);
    }

    /* ─── Hero ─── */
    .hero-section {
        position: relative;
        min-height: 85vh;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: linear-gradient(135deg, var(--site-primary, #1e3a5f) 0%, var(--site-secondary, #2d5a87) 100%);
    }

    .hero-section::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: linear-gradient(to top, var(--site-bg, #ffffff), transparent);
        z-index: 2;
    }

    .hero-clip {
        clip-path: none;
    }

    .hero-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(
            135deg,
            rgba(0,0,0, var(--overlay-opacity, 0.4)) 0%,
            rgba(0,0,0, calc(var(--overlay-opacity, 0.4) + 0.1)) 100%
        );
        z-index: 1;
    }

    .hero-content {
        position: relative;
        z-index: 3;
        text-align: center;
        padding: 2rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 6vw, 4.5rem);
        font-weight: 800;
        line-height: 1.15;
        color: #ffffff;
        letter-spacing: -0.01em;
    }

    .hero-accent-line {
        width: 0;
        height: 4px;
        margin: 1.5rem auto;
        background: var(--site-accent, #2563eb);
        border-radius: 2px;
        animation: accent-expand 1s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes accent-expand {
        to { width: 80px; }
    }

    /* ─── Section Shared ─── */
    .site-section {
        position: relative;
        padding: 5rem 0;
        overflow: hidden;
        background: var(--site-bg, #ffffff);
    }

    .site-section--alt {
        background: #f8fafc;
    }

    .site-section--dark {
        background: var(--site-primary, #1e3a5f);
        color: #ffffff;
    }

    .site-section--pattern {
        background-image: none;
    }

    .section-title {
        font-size: clamp(1.75rem, 3.5vw, 2.5rem);
        font-weight: 700;
        color: var(--site-text, #1f2937);
        margin-bottom: 0.5rem;
        position: relative;
        display: inline-block;
    }

    .site-section--dark .section-title {
        color: #ffffff;
    }

    .section-title::after {
        content: '';
        position: absolute;
        bottom: -8px;
        inset-inline-start: 0;
        width: 50px;
        height: 3px;
        background: var(--site-accent, #2563eb);
        border-radius: 2px;
    }

    /* ─── Cards ─── */
    .site-card {
        position: relative;
        border-radius: 1rem;
        overflow: hidden;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .site-card:hover {
        transform: translateY(-2px);
        border-color: var(--site-accent, #2563eb);
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    }

    .site-card__image {
        width: 100%;
        aspect-ratio: 4/3;
        object-fit: cover;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .site-card:hover .site-card__image {
        transform: scale(1.03);
    }

    .site-card__overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
        opacity: 0.8;
        transition: opacity 0.3s;
    }

    /* ─── Stats ─── */
    .stats-band {
        position: relative;
        background: var(--site-primary, #1e3a5f);
        overflow: hidden;
    }

    .stat-number {
        font-size: clamp(2.5rem, 5vw, 3.5rem);
        font-weight: 800;
        color: var(--site-accent, #2563eb);
        line-height: 1;
    }

    /* ─── Testimonials ─── */
    .testimonial-card {
        background: #ffffff;
        border-radius: 1rem;
        padding: 2rem;
        border: 1px solid #e5e7eb;
        position: relative;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .testimonial-card::before {
        content: '\201C';
        position: absolute;
        top: 0.75rem;
        inset-inline-start: 1.25rem;
        font-size: 4rem;
        line-height: 1;
        color: var(--site-accent, #2563eb);
        opacity: 0.15;
        font-family: serif;
    }

    /* ─── FAQ ─── */
    .faq-item {
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        overflow: hidden;
        transition: border-color 0.3s;
        background: #ffffff;
    }

    .faq-item:hover,
    .faq-item[data-open="true"] {
        border-color: var(--site-accent, #2563eb);
    }

    /* ─── CTA Section ─── */
    .cta-section {
        position: relative;
        background: linear-gradient(135deg, var(--site-primary, #1e3a5f), var(--site-secondary, #2d5a87));
        overflow: hidden;
    }

    .cta-section::before {
        content: none;
    }

    /* ─── Buttons ─── */
    .site-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.875rem 2rem;
        border-radius: 0.75rem;
        font-weight: 600;
        font-size: 1rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        text-decoration: none;
    }

    .site-btn--primary {
        background: var(--site-accent, #2563eb);
        color: white;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    }

    .site-btn--primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
    }

    .site-btn--outline {
        background: transparent;
        color: white;
        border: 2px solid rgba(255,255,255,0.4);
    }

    .site-btn--outline:hover {
        border-color: white;
        background: rgba(255,255,255,0.1);
    }

    /* ─── Footer ─── */
    .site-footer {
        background: var(--site-primary, #1e3a5f);
        color: #ffffff;
        border-top: none;
    }

    /* ─── WhatsApp Float ─── */
    .whatsapp-float {
        position: fixed;
        bottom: 1.5rem;
        inset-inline-end: 1.5rem;
        z-index: 90;
        width: 56px;
        height: 56px;
        background: #25d366;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
        transition: transform 0.3s;
        animation: whatsapp-pulse 2s infinite;
    }

    .whatsapp-float:hover {
        transform: scale(1.1);
    }

    @keyframes whatsapp-pulse {
        0%, 100% { box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); }
        50% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5), 0 0 0 6px rgba(37, 211, 102, 0.08); }
    }

    /* ─── Animations ─── */
    .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .reveal--visible {
        opacity: 1;
        transform: translateY(0);
    }

    .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; }

    /* ─── Map Container ─── */
    .map-container {
        border-radius: 1rem;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        height: 350px;
    }

    /* ─── Gallery Grid ─── */
    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }

    .gallery-item {
        position: relative;
        border-radius: 0.75rem;
        overflow: hidden;
        aspect-ratio: 3/2;
        cursor: pointer;
        border: 1px solid #e5e7eb;
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .gallery-item:hover img {
        transform: scale(1.05);
    }

    /* ─── Partners Logo Bar ─── */
    .partners-track {
        display: flex;
        gap: 3rem;
        animation: scroll-logos 30s linear infinite;
    }

    @keyframes scroll-logos {
        0% { transform: translateX(0); }
        100% { transform: translateX(-50%); }
    }

    /* ─── Contact Form ─── */
    .site-input {
        width: 100%;
        padding: 0.875rem 1rem;
        background: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 0.75rem;
        color: #1f2937;
        font-size: 1rem;
        transition: border-color 0.3s;
    }

    .site-input:focus {
        outline: none;
        border-color: var(--site-accent, #2563eb);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .site-input::placeholder {
        color: #9ca3af;
    }

    .site-section--dark .site-input {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.2);
        color: #ffffff;
    }

    .site-section--dark .site-input::placeholder {
        color: rgba(255,255,255,0.5);
    }

    /* ─── Empty/Skeleton States ─── */
    .skeleton-card {
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 1rem;
        overflow: hidden;
    }

    .skeleton-block {
        background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
        background-size: 200% 100%;
        animation: skeleton-shimmer 1.5s infinite;
        border-radius: 0.5rem;
    }

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

    .empty-state {
        text-align: center;
        padding: 3rem 1rem;
        color: #9ca3af;
    }

    .empty-state svg {
        margin: 0 auto 1rem;
        opacity: 0.4;
    }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero-section {
        min-height: 65vh;
    }

    .site-section {
        padding: 3rem 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
