/* ==========================================================
   ApeX Tools — Shared Stylesheet
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
    --bg-primary:    #0a0a0f;
    --bg-secondary:  #12121a;
    --bg-card:       #1a1a24;
    --bg-card-hover: #22222e;
    --bg-input:      #0d0d14;

    --text-primary:   #ffffff;
    --text-secondary: #a0a0b0;

    --accent-gold:     #c9a857;
    --accent-gold-dim: #a08840;
    --accent-green:    #00ff88;
    --accent-red:      #ff4757;
    --accent-cyan:     #00d4ff;

    --border-color: #2a2a3a;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

/* ── Base ──────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ────────────────────────────────────────────── */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Glassmorphism variant — pages with video backgrounds */
header.glass {
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Logo ──────────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo img {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-text span {
    color: var(--accent-gold);
}

/* ── Nav ───────────────────────────────────────────────── */
nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: color 0.15s;
}

nav a:hover,
nav a.active {
    color: var(--accent-gold);
}

/* ── User menu ─────────────────────────────────────────── */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-gold);
    flex-shrink: 0;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}

.logout-link:hover {
    color: var(--accent-gold);
}

.btn-login {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
    color: var(--bg-primary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 168, 87, 0.35);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(201, 168, 87, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

/* ── Footer ────────────────────────────────────────────── */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--accent-gold);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ── Video background (login / home / 404) ─────────────── */
.video-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
}

/* ── Alert / notification strips ──────────────────────── */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.alert-success {
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    nav {
        display: none;
    }

    header {
        padding: 0.875rem 1.25rem;
    }
}
