@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --gold-primary: #D4AF37;
    --gold-light:   #F0D060;
    --gold-dim:     #8B6914;
    --gold-dark:    #5C4A0A;
    --gold-glow:    rgba(212, 175, 55, 0.15);
    --gold-glow-strong: rgba(212, 175, 55, 0.35);
}

[data-theme="dark"], :root {
    --bg-primary:   #0A0A0A;
    --bg-secondary: #111111;
    --bg-card:      #1A1A1A;
    --bg-card-hover:#202020;
    --bg-input:     #141414;
    --text-primary: #F5F5F0;
    --text-muted:   #888888;
    --text-dim:     #555555;
    --border:       #2A2A2A;
    --border-gold:  rgba(212, 175, 55, 0.3);
    --shadow:       0 4px 24px rgba(0,0,0,0.6);
    --shadow-gold:  0 0 20px rgba(212, 175, 55, 0.2);
}

[data-theme="light"] {
    --bg-primary:   #FAFAF5;
    --bg-secondary: #F0EDD8;
    --bg-card:      #FFFFFF;
    --bg-card-hover:#F9F6E8;
    --bg-input:     #F5F2E0;
    --text-primary: #1A1A1A;
    --text-muted:   #555555;
    --text-dim:     #999999;
    --border:       #E0D5B0;
    --border-gold:  rgba(184, 134, 11, 0.4);
    --shadow:       0 4px 24px rgba(0,0,0,0.08);
    --shadow-gold:  0 0 20px rgba(184, 134, 11, 0.15);
    --gold-primary: #B8860B;
    --gold-light:   #D4AF37;
    --gold-dim:     #8B6914;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; display: block; }

/* ===== LAYOUT ===== */
.affligold-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ag-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.ag-container-sm {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

main.ag-main {
    flex: 1;
    padding: 2rem 0;
}

/* ===== HEADER ===== */
.ag-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.ag-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 78px;
    gap: 1rem;
}

.ag-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.ag-logo-img {
    height: 64px;
    width: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 640px) {
    .ag-logo-img { height: 50px; }
}

.ag-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ag-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.ag-nav a:hover,
.ag-nav a.active {
    color: var(--gold-primary);
    background: var(--gold-glow);
}

.ag-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Toggle */
.ag-theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}
.ag-theme-toggle:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* Profile Dropdown */
.ag-profile-btn {
    background: var(--gold-glow);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gold-primary);
    transition: all 0.2s;
    position: relative;
}
.ag-profile-btn:hover {
    background: var(--gold-glow-strong);
    box-shadow: var(--shadow-gold);
}

.ag-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    min-width: 180px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 200;
}

.ag-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: background 0.15s;
}
.ag-dropdown a:hover { background: var(--bg-card-hover); color: var(--gold-primary); }
.ag-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ===== FOOTER ===== */
.ag-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-gold);
    padding: 2rem 0;
    text-align: center;
}

.ag-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.ag-footer-logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gold-primary);
    line-height: 0;
}

.ag-footer-logo-img {
    height: 52px;
    width: auto;
    display: block;
    object-fit: contain;
}

.ag-footer-socials {
    display: flex;
    gap: 0.75rem;
}

.ag-footer-socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s;
}
.ag-footer-socials a:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.ag-footer-copy {
    color: var(--text-dim);
    font-size: 0.8rem;
    width: 100%;
    margin-top: 1rem;
}

/* ===== GOLD DIVIDER ===== */
.ag-gold-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    margin: 2rem 0;
    opacity: 0.4;
}

/* ===== PAGE TITLE ===== */
.ag-page-title {
    margin-bottom: 2rem;
}
.ag-page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}
.ag-page-title h1 span { color: var(--gold-primary); }
.ag-page-title p {
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-size: 0.95rem;
}

/* ===== MOBILE NAV ===== */
.ag-mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .ag-nav { display: none; }
    .ag-mobile-menu-btn { display: flex; }
    .ag-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        right: 0;
        left: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-gold);
        padding: 1rem;
        gap: 0.25rem;
    }
}
