/* ==========================================================================
   PrepareQuickly Base CSS Design System (ISO 25010 & WCAG 2.1 AA Compliant)
   ========================================================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-light: #eff6ff;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* ─── Accessible Reduced Motion Fallback (PQ-AUD-017) ─── */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background-color: var(--slate-50);
    color: var(--slate-800);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ─── Navbar & Dropdowns (Touch-Safe & Responsive: PQ-AUD-002, PQ-AUD-015) ─── */
.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Mobile & Tablet Collapse Transition (PQ-AUD-015) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }
    .navbar .dropdown-menu {
        border: 1px solid var(--slate-200);
        border-radius: 1rem;
        background: #ffffff;
        margin-top: 0.5rem;
        padding: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    }
}

/* Desktop & Laptop Mega-Menu (min-width: 992px) */
@media (min-width: 992px) {
    .navbar .dropdown.position-static {
        position: static;
    }
    
    .navbar .dropdown-menu {
        left: 0;
        right: 0;
        width: 100%;
        margin-top: 0;
        border: none;
        border-radius: 0 0 1.25rem 1.25rem;
        border-top: 1px solid var(--slate-100);
        background: #ffffff;
        box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15) !important;
        max-height: 82vh;
        overflow-y: auto;
    }

    /* Only enable CSS :hover on physical mouse devices (PQ-AUD-002) */
    @media (hover: hover) and (pointer: fine) {
        .navbar .dropdown:hover > .dropdown-menu {
            display: block;
            opacity: 1;
            visibility: visible;
            animation: megaMenuFade 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }
    }

    /* Deterministic click/tap toggle for touch devices, tablets & keyboard nav */
    .navbar .dropdown > .dropdown-menu.show,
    .navbar .dropdown.show > .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

@keyframes megaMenuFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Standardized Button Hierarchy & Contrast Tokens (PQ-AUD-005, PQ-AUD-006) ─── */
.btn {
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-1.5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

/* WCAG 2.1 AA Contrast Compliant Text Tokens */
.text-muted, .text-slate-600 {
    color: var(--slate-700) !important; /* Minimum 4.5:1 ratio */
}

/* ─── Footer Layout (PQ-AUD-013) ─── */
footer {
    background: var(--slate-900);
    color: #cbd5e1;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s ease;
}

footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

footer .footer-heading {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}
