/*
 * Shared by every page: colours, background, header and navigation,
 * and the floating WhatsApp button. The footer is in footer.css.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-purple: #c084fc;
    --accent-pink: #ec4899;
    --silver: #c0c0c0;
    --silver-light: #e8e8e8;
    --text-light: #e8e3db;
    --heading: #e8e8e8;
    --card-bg: rgba(26, 15, 40, 0.72);
    --card-border: rgba(192, 132, 252, 0.28);
    --muted: rgba(232, 227, 219, 0.68);
    --chip-bg: rgba(192, 132, 252, 0.12);
}

html[data-theme="light"] {
    --text-light: #3d3555;
    --silver: #6e5f82;
    --silver-light: #faf7ff;
    --heading: #4a3d5c;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(124, 58, 237, 0.18);
    --muted: rgba(61, 53, 85, 0.68);
    --chip-bg: rgba(192, 132, 252, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0514 0%, #1a0f28 30%, #2a1a3f 70%, #1a0f28 100%);
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
}

html[data-theme="light"] body {
    background: linear-gradient(135deg, #fefcff 0%, #f3e8ff 38%, #fce7f3 72%, #faf5ff 100%);
}

html[data-theme="light"] body::after {
    opacity: 0.32;
    filter: blur(72px);
}

[lang="ar"] body {
    font-family: 'Tajawal', 'Amiri', sans-serif;
}

a {
    text-decoration: none;
}

main {
    position: relative;
    z-index: 1;
}

/* ---------- Header ---------- */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 15, 40, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 2px solid transparent;
    background-image: linear-gradient(rgba(26, 15, 40, 0.85), rgba(26, 15, 40, 0.85)),
        linear-gradient(90deg, var(--accent-purple), var(--accent-pink), var(--accent-purple));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    padding: 0.7rem 0;
    box-shadow: 0 4px 30px rgba(192, 132, 252, 0.1);
}

html[data-theme="light"] header {
    background-color: transparent;
    background-image: linear-gradient(rgba(255, 252, 255, 0.94), rgba(255, 252, 255, 0.94)),
        linear-gradient(90deg, var(--accent-purple), var(--accent-pink), var(--accent-purple));
    box-shadow: 0 4px 28px rgba(124, 58, 237, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.35));
}

.logo-img--light,
html[data-theme="light"] .logo-img--dark {
    display: none;
}

html[data-theme="light"] .logo-img--light {
    display: block;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(192, 132, 252, 0.35);
    background: rgba(192, 132, 252, 0.12);
    color: var(--text-light);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.nav-toggle:hover {
    border-color: rgba(192, 132, 252, 0.55);
    background: rgba(192, 132, 252, 0.2);
}

.nav-toggle i {
    font-size: 1.1rem;
}

.nav-toggle-icon--close,
.nav-toggle.is-open .nav-toggle-icon--open {
    display: none;
}

.nav-toggle.is-open .nav-toggle-icon--close {
    display: inline-block;
}

.nav-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
}

.nav-menu {
    display: flex;
    gap: 1.35rem;
    list-style: none;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-menu > li > a,
.nav-dropdown summary {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.nav-menu > li > a {
    display: inline-block;
    padding: 0.2rem 0;
}

.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    inset-inline-start: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
    transition: width 0.25s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.is-current,
.nav-dropdown summary.is-current {
    color: var(--accent-purple);
}

.nav-menu > li > a:hover::after,
.nav-menu > li > a.is-current::after {
    width: 100%;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.72rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.nav-dropdown[open] summary {
    color: var(--accent-purple);
}

.nav-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.65rem);
    inset-inline-end: 0;
    min-width: 168px;
    list-style: none;
    margin: 0;
    padding: 0.45rem;
    border-radius: 14px;
    background: rgba(22, 12, 34, 0.97);
    border: 1px solid rgba(192, 132, 252, 0.28);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    z-index: 120;
}

.nav-dropdown-menu li {
    list-style: none;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.is-current {
    background: rgba(192, 132, 252, 0.14);
    color: var(--accent-purple);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-inline-start: 1rem;
    margin-inline-start: 0.25rem;
    border-inline-start: 1px solid rgba(192, 132, 252, 0.22);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.25), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(192, 132, 252, 0.45);
    color: var(--text-light);
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(192, 132, 252, 0.35);
    border-color: rgba(236, 72, 153, 0.55);
}

.theme-toggle i {
    font-size: 1rem;
}

.theme-icon-sun,
html[data-theme="light"] .theme-icon-moon {
    display: none;
}

html[data-theme="light"] .theme-icon-sun {
    display: inline-block;
}

.lang-toggle {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: #fff;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.82rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(192, 132, 252, 0.35);
    white-space: nowrap;
}

.lang-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(192, 132, 252, 0.45);
}

.lang-toggle[lang="ar"] {
    font-family: 'Tajawal', sans-serif;
}

html[data-theme="light"] .theme-toggle {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(236, 72, 153, 0.12));
    border-color: rgba(124, 58, 237, 0.35);
    color: #4a3d5c;
}

html[data-theme="light"] .nav-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(124, 58, 237, 0.18);
}

html[data-theme="light"] .nav-toggle {
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(124, 58, 237, 0.25);
    color: #4a3d5c;
}

/* ---------- Floating WhatsApp button ---------- */

.whatsapp-float {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(145deg, #25d366, #128c7e);
    color: #fff;
    font-size: 1.85rem;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 32px rgba(37, 211, 102, 0.55), 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.whatsapp-float:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.7);
    outline-offset: 3px;
}

html[data-theme="light"] .whatsapp-float {
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.35), 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* ---------- Small screens ---------- */

@media (max-width: 1024px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-panel {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 0.7rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        background: rgba(22, 12, 34, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(192, 132, 252, 0.2);
        transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    }

    html[data-theme="light"] .nav-panel {
        background: rgba(255, 255, 255, 0.98);
        border-bottom-color: rgba(124, 58, 237, 0.15);
    }

    .nav-panel.is-open {
        max-height: min(85vh, 640px);
        overflow-y: auto;
        opacity: 1;
        pointer-events: auto;
        padding: 0.85rem 1.25rem 1.15rem;
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        width: 100%;
    }

    .nav-menu > li > a,
    .nav-dropdown summary {
        display: flex;
        width: 100%;
        padding: 0.7rem 0.5rem;
        font-size: 0.95rem;
    }

    .nav-menu > li > a::after {
        display: none;
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        margin-top: 0.15rem;
        padding-block: 0.15rem 0.35rem;
        padding-inline: 0.75rem 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    html[data-theme="light"] .nav-dropdown-menu {
        background: transparent;
    }

    .nav-dropdown-menu a {
        padding: 0.6rem 0.5rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        margin: 0.85rem 0 0;
        padding: 0.85rem 0 0;
        border-inline-start: none;
        border-top: 1px solid rgba(192, 132, 252, 0.2);
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.65rem 0;
    }

    header nav {
        padding: 0 1rem;
    }

    .logo-img {
        height: 34px;
    }

    .whatsapp-float {
        right: 1rem;
        bottom: 1rem;
        width: 54px;
        height: 54px;
        font-size: 1.7rem;
    }
}
