/* ─── Modern Design Tokens & CSS Variables ─── */
:root {
    /* Brand Default Identity (Alsalmi Dark Blue) */
    --primary-color: #1B3665;
    --secondary-color: #2596BE;
    
    /* Semantic Status Colors */
    --success-color: #24AE50;
    --warning-color: #F59E0B;
    --error-color: #D01F27;
    --info-color: #1E56A0;

    /* Light Theme Palette */
    --bg-base: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-glass: rgba(255, 255, 255, 0.85);
    --border-color: #E2E8F0;
    --border-glass: rgba(226, 232, 240, 0.5);
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --header-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    
    /* Layout Tokens */
    --container-max-width: 1200px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Preference (Play Console & GDPR Compliant Native Rendering) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0F172A;
        --bg-surface: #1E293B;
        --bg-surface-glass: rgba(30, 41, 59, 0.85);
        --border-color: #334155;
        --border-glass: rgba(51, 65, 85, 0.5);
        
        --text-primary: #F8FAFC;
        --text-secondary: #E2E8F0;
        --text-muted: #64748B;
        
        --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
        --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
        --header-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    }
}

/* ─── Core Reset & Typography Setup ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Offset for sticky header */
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
    transition: var(--transition-smooth);
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Premium Glassmorphism Header ─── */
.app-header {
    background-color: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--header-shadow);
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-badge .badge {
    background-color: rgba(36, 174, 80, 0.1);
    color: var(--success-color);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(36, 174, 80, 0.2);
}

/* ─── Prominent Disclosure Banner ─── */
.prominent-disclosure {
    background: linear-gradient(135deg, var(--primary-color), #14284d);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 40px;
    margin-bottom: 40px;
    display: flex;
    gap: 24px;
    align-items: center;
    box-shadow: 0 10px 20px rgba(27, 54, 101, 0.15);
}

.prominent-disclosure h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.prominent-disclosure p {
    font-size: 13.5px;
    opacity: 0.9;
    line-height: 1.6;
}

.prominent-disclosure .icon-holder {
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

/* ─── Main Content Grid ─── */
.content-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-bottom: 80px;
}

/* Sticky Navigation Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 120px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.nav-list a:hover,
.nav-list a.active {
    background-color: rgba(27, 54, 101, 0.06);
    color: var(--primary-color);
}

.sticky-sidebar:has(a:hover) a.active:not(:hover) {
    background-color: transparent;
    color: var(--text-secondary);
}

/* Dark Mode adjustment for active list item */
@media (prefers-color-scheme: dark) {
    .nav-list a:hover,
    .nav-list a.active {
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--secondary-color);
    }
}

.sidebar-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-footer .copyright-note {
    font-size: 10.5px;
    opacity: 0.8;
}

/* ─── Legal Article Styling ─── */
.legal-article {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--card-shadow);
}

.legal-article section {
    scroll-margin-top: 100px;
}

.legal-article h2 {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sec-num {
    background-color: var(--primary-color);
    color: #FFFFFF;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Match secondary color for number in dark mode */
@media (prefers-color-scheme: dark) {
    .sec-num {
        background-color: var(--secondary-color);
        color: #0F172A;
    }
}

.legal-article p {
    font-size: 14.5px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    text-align: justify;
}

.legal-article ul {
    margin-right: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-article li {
    font-size: 14.5px;
    color: var(--text-secondary);
}

.section-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 40px 0;
}

/* ─── Component 4: Premium Boxes & Cards ─── */

/* Modern Callout Note boxes */
.note-box {
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    display: flex;
    gap: 16px;
    font-size: 13.5px;
    border-width: 1px;
    border-style: solid;
    align-items: flex-start;
}

.note-box i {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-info {
    background-color: rgba(30, 86, 160, 0.05);
    border-color: rgba(30, 86, 160, 0.15);
    color: var(--info-color);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.alert-warning i {
    color: var(--warning-color);
}

/* Modern Data Cards */
.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.data-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition-smooth);
}

.data-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow-hover);
}

.card-icon {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.data-card h4 {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.data-card p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 0;
    text-align: right;
    line-height: 1.5;
}

/* ─── Component 7: Deletion Channels & Contact ─── */
.deletion-channels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.deletion-channel {
    background-color: var(--bg-base);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition-smooth);
}

.deletion-channel:hover {
    border-color: var(--error-color);
}

.channel-icon {
    font-size: 32px;
    color: var(--error-color);
    margin-bottom: 16px;
}

.deletion-channel h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.deletion-channel p {
    font-size: 12.5px;
    text-align: center;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Contact box information layer */
.contact-box {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.contact-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.item-title {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-value {
    font-weight: 600;
    color: var(--primary-color);
}

.item-value a {
    color: inherit;
    text-decoration: none;
}

/* ─── Premium Footer ─── */
.app-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    transition: var(--transition-smooth);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand .brand-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.footer-brand p {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ─── Responsive Adjustments (Desktop-first) ─── */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* Hide sticky index index on small screens */
    }
}

@media (max-width: 768px) {
    .prominent-disclosure {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .deletion-channels {
        grid-template-columns: 1fr;
    }
    
    .header-badge {
        display: none; /* Hide badge on mobile */
    }
    
    .contact-item {
        flex-direction: column;
        gap: 4px;
    }
    
    .legal-article {
        padding: 24px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}
