/* ========================================
   Slammo.org - Shared Stylesheet
   Modern dark theme to complement chrome logo
   ======================================== */

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

:root {
    --bg-primary: #060608;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: #1a1a1a;
    --border-color: #2a2a2a;
    --border-hover: #3d3d3d;
    --text-primary: #f5f5f5;
    --text-secondary: #b8b8b8;
    --text-muted: #707070;
    --accent: #c0c0c0;
    --accent-bright: #e8e8e8;
    --accent-blue: #4a9eff;
    --accent-red: #e63946;
    --shadow-glow: 0 0 30px rgba(192, 192, 192, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.6);
    --gradient-chrome: linear-gradient(135deg, #e8e8e8 0%, #888 50%, #c0c0c0 100%);
    --gradient-bg: radial-gradient(ellipse at top, #1a1a1a 0%, #0a0a0a 70%);
}

html {
    height: 100%;
    /* Base color sits on html so the body's animated gradient pseudo-elements
       remain visible. (A solid background on body would paint over them.) */
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    height: 100%;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ===== Atmospheric background layers =====
   Two stacked, fixed pseudo-elements behind the main content:
   - Base layer: a soft static vignette + dark gradient that fades smoothly
     from a slightly-lit center out to deep black at the edges.
   - Animated mist layer: gently drifting pools of bluish-silver light that
     simulate slow-moving fog. The motion is slow enough to feel ambient
     (not distracting) and pauses for users who prefer reduced motion.
*/
body::before {
    content: '';
    position: fixed;
    inset: 0;
    /* One smooth radial gradient that extends well beyond the viewport so
       there's no visible fade-out point on screen. */
    background: radial-gradient(ellipse 160% 130% at 50% 30%,
        #14161e 0%,
        #0d0f14 30%,
        #08090d 60%,
        #050507 100%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    inset: -25%;
    /* Five overlapping mist pools arranged so there's no horizontal gap;
       the large center pool fills any space the corners miss. */
    background:
        radial-gradient(ellipse 60% 50% at 25% 25%, rgba(74, 158, 255, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 75% 30%, rgba(74, 158, 255, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 90% 70% at 50% 55%, rgba(192, 192, 192, 0.05) 0%, transparent 75%),
        radial-gradient(ellipse 55% 45% at 30% 80%, rgba(192, 192, 192, 0.06) 0%, transparent 72%),
        radial-gradient(ellipse 60% 50% at 80% 75%, rgba(192, 192, 192, 0.07) 0%, transparent 72%);
    z-index: -1;
    pointer-events: none;
    animation: mistDrift 32s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

@keyframes mistDrift {
    0% {
        transform: translate(0%, 0%) scale(1) rotate(0deg);
        opacity: 0.85;
    }
    33% {
        transform: translate(2.5%, -1.5%) scale(1.06) rotate(0.5deg);
        opacity: 1;
    }
    66% {
        transform: translate(-1.5%, 2%) scale(1.03) rotate(-0.3deg);
        opacity: 0.9;
    }
    100% {
        transform: translate(1.5%, -2%) scale(1.08) rotate(0.4deg);
        opacity: 0.95;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::after {
        animation: none;
    }
}

a {
    color: var(--accent-bright);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-blue);
}

/* ========== Navigation ========== */
.navbar {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.8;
}

.navbar-logo {
    height: 42px;
    width: auto;
}

.navbar-links {
    display: flex;
    gap: 28px;
    align-items: center;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    padding: 6px 0;
    position: relative;
    transition: color 0.2s ease;
}

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

.navbar-links a.active {
    color: var(--accent-bright);
}

.navbar-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-chrome);
    border-radius: 2px;
}

/* User name in the navbar */
.user-name-link,
.user-name-display {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.user-name-link:hover {
    border-color: var(--accent-bright);
    background: rgba(192, 192, 192, 0.08);
    color: var(--text-primary);
}

.user-name-display {
    color: var(--text-secondary);
    cursor: default;
}

/* Logout button (used inside the account page sidebar) */
.btn-logout {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
    margin-top: 12px;
}

.btn-logout:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: rgba(230, 57, 70, 0.08);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--gradient-chrome);
    color: #0a0a0a;
    border: none;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
    color: #000;
}

.btn-secondary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent-bright);
}

.btn-secondary:hover {
    background: rgba(192, 192, 192, 0.08);
    border-color: var(--accent-bright);
}

.btn-block {
    width: 100%;
}

/* ========== Container & Layout ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    width: 100%;
}

main {
    flex: 1;
    padding: 48px 0;
}

/* ========== Page Header ========== */
.page-header {
    text-align: center;
    margin-bottom: 56px;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-chrome);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.page-header p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s ease;
}

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

.card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 24px;
}

/* ========== Section ========== */
.section {
    margin-bottom: 72px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

/* ========== Footer ========== */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: auto;
}

footer a {
    color: var(--text-secondary);
}

/* ========== Form ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(192, 192, 192, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ========== Alerts ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.3);
    color: #ff6b75;
}

.alert-info {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
    color: var(--accent-blue);
}

/* ========== Cart icon (navbar) ========== */
.cart-icon {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.cart-icon:hover {
    border-color: var(--accent-bright);
    background: rgba(192, 192, 192, 0.08);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

/* ========== Cart drawer ========== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 200;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 201;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.cart-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-header-count {
    font-size: 12px;
    background: var(--accent-red);
    color: white;
    padding: 2px 9px;
    border-radius: 10px;
    font-weight: 700;
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cart-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Cart item card */
.cart-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 12px;
}

.cart-item-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.cart-item-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-family: inherit;
    padding: 0;
}

.qty-btn:hover:not(:disabled) {
    border-color: var(--accent-bright);
    background: var(--bg-card);
}

.qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    margin-left: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.remove-btn:hover {
    color: var(--accent-red);
    background: rgba(230, 57, 70, 0.08);
}

.cart-item-price {
    font-weight: 700;
    color: var(--accent-bright);
    font-size: 15px;
    white-space: nowrap;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.cart-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cart-empty h4 {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 6px;
}

.cart-totals {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 6px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.cart-total-row.total {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 10px;
}

/* Add to Cart button on product cards */
.btn-add-cart {
    width: 100%;
    padding: 8px 12px;
    margin-top: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--gradient-chrome);
    color: #0a0a0a;
    border-color: transparent;
}

.btn-add-cart:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-add-cart.in-cart {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .navbar {
        padding: 14px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .navbar-links {
        gap: 18px;
        font-size: 14px;
    }
    .container {
        padding: 0 20px;
    }
    .page-header h1 {
        font-size: 34px;
    }
    .section-title {
        font-size: 26px;
    }
}
