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

:root {
    --bg:        #ffffff;
    --surface:   #f9fafb;
    --card:      #ffffff;
    --border:    #e5e7eb;
    --primary:   #f97316;
    --primary-h: #ea6c10;
    --primary-l: #fff7ed;
    --dark:      #111827;
    --dark2:     #1f2937;
    --dark3:     #374151;
    --green:     #10b981;
    --red:       #ef4444;
    --gold:      #f59e0b;
    --text:      #111827;
    --text2:     #374151;
    --muted:     #9ca3af;
    --shadow:    0 4px 20px rgba(0,0,0,.07);
    --shadow-md: 0 8px 32px rgba(0,0,0,.1);
    --radius:    14px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── NAVBAR ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--dark);
    padding: 0 2.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.navbar-brand span { color: var(--primary); }

.navbar-links {
    display: flex;
    gap: .25rem;
    list-style: none;
    flex: 1;
}
.navbar-links a {
    font-size: .9rem;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    transition: all .2s;
    padding: .42rem .95rem;
    border-radius: 50px;
    border-bottom: none;
    display: block;
}
.navbar-links a:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
.navbar-links a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.35rem;
    border-radius: 50px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover {
    background: var(--primary-h);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(249,115,22,.35);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-l);
}
.btn-outline-white {
    background: transparent;
    color: rgba(255,255,255,.8);
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: 50px;
    padding: .5rem 1.35rem;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.btn-outline-white:hover {
    color: #fff;
    border-color: rgba(255,255,255,.6);
    background: rgba(255,255,255,.06);
}
.btn-ghost { background: transparent; color: rgba(255,255,255,.7); border: none; cursor: pointer; }
.btn-ghost:hover { color: #fff; }
.btn-dark { background: var(--dark); color: #fff; border: none; }
.btn-dark:hover { background: var(--dark2); }
.btn-sm { padding: .35rem .9rem; font-size: .8rem; }
.btn-lg { padding: .72rem 2rem; font-size: 1rem; }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0; top: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 164px;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    font-size: .875rem;
    color: var(--text);
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover { background: var(--primary-l); color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ── MAIN ── */
main { flex: 1; }

/* ── FOOTER ── */
footer {
    background: var(--dark);
    padding: 2rem 2.5rem;
    text-align: center;
    color: rgba(255,255,255,.4);
    font-size: .85rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
footer a { color: var(--primary); }
footer a:hover { text-decoration: underline; }

/* ── SECTION ── */
.section { padding: 2.5rem 2rem; max-width: 1280px; margin: 0 auto; }
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--text);
}
.section-title .accent { color: var(--primary); }

/* ── DARK SECTION ── */
.dark-band {
    background: var(--dark);
    padding: 3rem 0;
}
.dark-band .section-title { color: #fff; }
.dark-band .section-title .accent { color: var(--primary); }

/* ── CARD ── */
.cw-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.cw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.11);
    border-color: var(--primary);
}
.cw-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
}
.cw-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cw-card-body { padding: 1rem; }
.cw-card-title {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.cw-card-meta {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: var(--muted);
}
.cw-card-meta span { display: flex; align-items: center; gap: .2rem; }

.cat-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 600;
}

/* ── TOAST ── */
#toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.toast {
    padding: .7rem 1.25rem;
    border-radius: 50px;
    font-size: .875rem;
    font-weight: 500;
    animation: slideIn .3s ease;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red);   color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }
@keyframes slideIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform:none; } }
@keyframes fadeOut { to { opacity:0; transform: translateX(40px); } }

/* ── MOBILE ── */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1.4rem;
}

@media (max-width: 768px) {
    .navbar { padding: 0 1rem; gap: 1rem; }
    .navbar-links { display: none; }
    .navbar-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 68px; left: 0; right: 0;
        background: var(--dark);
        padding: 1rem;
        z-index: 99;
        gap: .25rem;
        box-shadow: 0 8px 24px rgba(0,0,0,.3);
    }
    .navbar-links.open a { border-radius: 10px; }
    .hamburger { display: block; }
    .section { padding: 2rem 1rem; }
}
