/* ============================================================
   GAMEZITI — Global Styles & Header
   Fuente única de verdad. No duplicar en header.php.
   ============================================================ */

/* ---------- CSS Variables (Dark default) ---------- */
:root {
    /* Core palette */
    --gz-bg-deep:       #0a0a0f;
    --gz-bg-surface:    #111118;
    --gz-bg-elevated:   #1a1a24;
    --gz-bg-glass:      rgba(17, 17, 24, 0.85);
    --gz-border:        rgba(255, 255, 255, 0.06);
    --gz-border-hover:  rgba(255, 255, 255, 0.12);

    /* Text */
    --gz-text-primary:  #eaeaf0;
    --gz-text-secondary:#8b8b9e;
    --gz-text-muted:    #55556a;

    /* Accent — electric cyan / neon */
    --gz-accent:        #00e5ff;
    --gz-accent-dim:    rgba(0, 229, 255, 0.15);
    --gz-accent-glow:   rgba(0, 229, 255, 0.35);
    --gz-accent-alt:    #7c4dff;
    --gz-accent-alt-dim:rgba(124, 77, 255, 0.15);

    /* Gradient combos */
    --gz-grad-accent:   linear-gradient(135deg, #00e5ff 0%, #7c4dff 100%);
    --gz-grad-surface:  linear-gradient(180deg, var(--gz-bg-surface) 0%, var(--gz-bg-deep) 100%);

    /* Typography */
    --gz-ff-display:    'Chakra Petch', sans-serif;
    --gz-ff-body:       'Exo 2', sans-serif;
    --gz-ff-ui:         'Rajdhani', sans-serif;

    /* Layout */
    --gz-container:     1280px;
    --gz-header-h:      90px;
    --gz-topbar-h:      36px;
    --gz-radius:        8px;
    --gz-radius-sm:     4px;

    /* Transitions */
    --gz-ease:          cubic-bezier(0.22, 1, 0.36, 1);
    --gz-speed:         0.25s;
}

/* ---------- Light theme override ---------- */
.gz-light {
    --gz-bg-deep:       #f0f1f5;
    --gz-bg-surface:    #ffffff;
    --gz-bg-elevated:   #eaebf0;
    --gz-bg-glass:      rgba(255, 255, 255, 0.9);
    --gz-border:        rgba(0, 0, 0, 0.07);
    --gz-border-hover:  rgba(0, 0, 0, 0.14);
    --gz-text-primary:  #12121a;
    --gz-text-secondary:#5a5a72;
    --gz-text-muted:    #9999aa;
    --gz-accent:        #0091ea;
    --gz-accent-dim:    rgba(0, 145, 234, 0.1);
    --gz-accent-glow:   rgba(0, 145, 234, 0.25);
    --gz-accent-alt:    #651fff;
    --gz-accent-alt-dim:rgba(101, 31, 255, 0.1);
    --gz-grad-accent:   linear-gradient(135deg, #0091ea 0%, #651fff 100%);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    scroll-padding-top: calc(var(--gz-topbar-h) + var(--gz-header-h) + 16px);
}
body {
    font-family: var(--gz-ff-body);
    background: var(--gz-bg-deep);
    color: var(--gz-text-primary);
    line-height: 1.6;
}
@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;
    }
}

/* ---------- Skip-to-content link (a11y) ---------- */
.gz-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 9999;
    padding: 12px 20px;
    background: var(--gz-accent);
    color: #0a0a0f;
    font-family: var(--gz-ff-ui);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-radius: var(--gz-radius);
    transition: top var(--gz-speed) var(--gz-ease);
}
.gz-skip-link:focus {
    top: 16px;
    outline: 2px solid var(--gz-text-primary);
    outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }
img { max-width: 100%; display: block; }

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

/* ---------- Header wrapper ---------- */
.gz-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    transition: transform var(--gz-speed) var(--gz-ease);
}
.gz-header--hidden { transform: translateY(-100%); }
.gz-header-spacer { height: calc(var(--gz-topbar-h) + var(--gz-header-h)); }

/* ==================== TOP BAR ==================== */
.gz-topbar {
    height: var(--gz-topbar-h);
    background: var(--gz-bg-deep);
    border-bottom: 1px solid var(--gz-border);
    font-family: var(--gz-ff-ui);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gz-text-secondary);
    overflow: hidden;
}
.gz-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.gz-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex: 1;
}
.gz-topbar__trending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gz-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
}
.gz-topbar__trending .gz-icon { width: 13px; height: 13px; }

/* Ticker */
.gz-topbar__ticker { overflow: hidden; flex: 1; position: relative; }
.gz-topbar__ticker::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 48px;
    background: linear-gradient(90deg, transparent, var(--gz-bg-deep));
    pointer-events: none;
}
.gz-topbar__ticker-track {
    display: flex;
    gap: 32px;
    white-space: nowrap;
    animation: gz-ticker 30s linear infinite;
}
.gz-topbar__ticker-item {
    flex-shrink: 0;
    transition: color var(--gz-speed);
}
.gz-topbar__ticker-item:hover { color: var(--gz-accent); }
@keyframes gz-ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Social icons (top bar right area, currently unused but kept for future) */
.gz-topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-left: 16px;
}
.gz-topbar__social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    color: var(--gz-text-muted);
    transition: color var(--gz-speed), background var(--gz-speed);
}
.gz-topbar__social:hover {
    color: var(--gz-accent);
    background: var(--gz-accent-dim);
}
.gz-topbar__social svg { width: 14px; height: 14px; }

/* ==================== MAIN NAV ==================== */
.gz-nav {
    height: var(--gz-header-h);
    background: var(--gz-bg-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--gz-border);
    transition: height var(--gz-speed) var(--gz-ease), box-shadow var(--gz-speed);
    position: relative;
}
.gz-nav--scrolled {
    height: 70px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.gz-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 24px;
}
/* Glow line under header */
.gz-nav::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gz-accent) 30%, var(--gz-accent-alt) 70%, transparent 100%);
    opacity: 0.4;
    pointer-events: none;
}

/* ---------- Logo ----------
   TODO: re-exportar /img/logogameziti.webp recortado (sin padding extra)
   para que no necesite escalar ni recortar con overflow.
*/
.gz-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity var(--gz-speed) var(--gz-ease);
}
.gz-logo:hover { opacity: 0.85; }
.gz-logo__img {
    height: 56px;
    width: auto;
    display: block;
}

/* ---------- Menu ---------- */
.gz-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}
.gz-menu__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-family: var(--gz-ff-ui);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gz-text-secondary);
    border-radius: var(--gz-radius);
    transition: color var(--gz-speed), background var(--gz-speed);
}
.gz-menu__link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; transform: translateX(-50%) scaleX(0);
    width: 24px; height: 2px;
    background: var(--gz-grad-accent);
    border-radius: 2px;
    transition: transform var(--gz-speed) var(--gz-ease);
}
.gz-menu__link:hover {
    color: var(--gz-text-primary);
    background: var(--gz-accent-dim);
}
.gz-menu__link:hover::after,
.gz-menu__link--active::after {
    transform: translateX(-50%) scaleX(1);
}
.gz-menu__link--active {
    color: var(--gz-accent);
}

/* ---------- Icon buttons ---------- */
.gz-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: var(--gz-text-secondary);
    transition: color var(--gz-speed), background var(--gz-speed);
}
.gz-btn-icon:hover {
    color: var(--gz-accent);
    background: var(--gz-accent-dim);
}
.gz-icon { width: 20px; height: 20px; }

/* ---------- Nav actions ---------- */
.gz-nav__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ---------- Theme toggle ---------- */
.gz-theme-toggle .gz-icon--moon { display: none; }
.gz-light .gz-theme-toggle .gz-icon--sun { display: none; }
.gz-light .gz-theme-toggle .gz-icon--moon { display: block; }

/* ---------- Hamburger ---------- */
.gz-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px; height: 38px;
    border-radius: var(--gz-radius);
}
.gz-hamburger__line {
    display: block;
    width: 20px; height: 2px;
    background: var(--gz-text-secondary);
    border-radius: 2px;
    transition: transform var(--gz-speed) var(--gz-ease), opacity var(--gz-speed), background var(--gz-speed);
}
.gz-hamburger:hover .gz-hamburger__line { background: var(--gz-accent); }

/* ==================== SEARCH OVERLAY ==================== */
.gz-search {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--gz-bg-surface);
    border-bottom: 1px solid var(--gz-border);
    padding: 16px 0;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--gz-speed) var(--gz-ease), opacity var(--gz-speed), visibility var(--gz-speed);
}
.gz-search--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
.gz-search__form {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gz-bg-elevated);
    border: 1px solid var(--gz-border);
    border-radius: 60px;
    padding: 4px 6px 4px 20px;
    transition: border-color var(--gz-speed);
}
.gz-search__form:focus-within { border-color: var(--gz-accent); }
.gz-search__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--gz-ff-body);
    font-size: 1rem;
    color: var(--gz-text-primary);
    padding: 10px 0;
}
.gz-search__input::placeholder { color: var(--gz-text-muted); }
.gz-search__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gz-grad-accent);
    color: #0a0a0f;
    flex-shrink: 0;
    transition: transform var(--gz-speed) var(--gz-ease), box-shadow var(--gz-speed);
}
.gz-search__submit:hover {
    transform: scale(1.06);
    box-shadow: 0 0 16px var(--gz-accent-glow);
}
.gz-search__submit .gz-icon { width: 18px; height: 18px; }
.gz-search__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    color: var(--gz-text-muted);
    flex-shrink: 0;
    transition: color var(--gz-speed);
}
.gz-search__close:hover { color: var(--gz-text-primary); }

/* ==================== MOBILE DRAWER ==================== */
.gz-drawer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;
}
.gz-drawer--open { visibility: visible; pointer-events: all; }
.gz-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.35s var(--gz-ease);
}
.gz-drawer--open .gz-drawer__overlay { opacity: 1; }
.gz-drawer__panel {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: min(320px, 85vw);
    background: var(--gz-bg-surface);
    border-left: 1px solid var(--gz-border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s var(--gz-ease);
}
.gz-drawer--open .gz-drawer__panel { transform: translateX(0); }
.gz-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--gz-border);
}
.gz-drawer__logo-img {
    height: 48px;
    width: auto;
    display: block;
}
.gz-drawer__menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
}
.gz-drawer__link {
    display: block;
    padding: 14px 16px;
    font-family: var(--gz-ff-ui);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gz-text-secondary);
    border-radius: var(--gz-radius);
    transition: color var(--gz-speed), background var(--gz-speed);
}
.gz-drawer__link:hover,
.gz-drawer__link--active {
    color: var(--gz-accent);
    background: var(--gz-accent-dim);
}
.gz-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gz-border);
    text-align: center;
    font-family: var(--gz-ff-ui);
    font-size: 0.75rem;
    color: var(--gz-text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .gz-menu { display: none; }
    .gz-hamburger { display: flex; }
}
@media (max-width: 640px) {
    .gz-topbar { font-size: 0.65rem; height: 30px; }
    .gz-topbar__trending { font-size: 0.65rem; gap: 4px; }
    .gz-topbar__trending .gz-icon { width: 11px; height: 11px; }
    .gz-nav { height: 64px; }
    .gz-nav--scrolled { height: 56px; }
    .gz-header-spacer { height: calc(30px + 64px); }
    .gz-container { padding: 0 12px; }
    .gz-logo__img { height: 42px; }
    .gz-btn-icon { width: 32px; height: 32px; }
    .gz-btn-icon .gz-icon { width: 17px; height: 17px; }
    .gz-hamburger { width: 32px; height: 32px; }
    .gz-hamburger__line { width: 17px; }
}
