/* ============================================================
   Block Forge — Shared Styles (nav + theme + layout)
   ============================================================ */

/* ===== Theme Variables (Light) ===== */
:root {
    --bg-body: #ffffff;
    --bg-overlay: rgba(200, 200, 210, 0.35);
    --nav-bg: rgba(245, 245, 250, 0.92);
    --container-bg: rgba(245, 245, 250, 0.92);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-bg-hover: rgba(255, 255, 255, 0.95);
    --text-primary: #1a1a2e;
    --text-secondary: #2a2a42;
    --text-muted: #4a4a6a;
    --text-light: #6a6a8a;
    --text-lighter: #8a8aaa;
    --border-light: rgba(200, 200, 220, 0.4);
    --border-medium: rgba(200, 200, 220, 0.5);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-nav: 0 6px 30px rgba(0, 0, 0, 0.15);
    --accent: #5b8c3a;
    --accent-hover: #3f6e25;
    --accent2: #4a6a9e;
    --badge-bg: rgba(200, 200, 220, 0.4);
    --badge-text: #3a3a5a;
    --toast-bg: rgba(0, 0, 0, 0.75);
    --toast-text: #ffffff;
    --custom-bg-color: #ffffff;
    --custom-bg-image: none;
    --transition-smooth: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Theme Variables (Dark) ===== */
[data-theme="dark"] {
    --bg-body: #0f0f1a;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(25, 25, 40, 0.95);
    --container-bg: rgba(20, 20, 35, 0.88);
    --card-bg: rgba(35, 35, 55, 0.75);
    --card-bg-hover: rgba(45, 45, 65, 0.85);
    --text-primary: #e8e8f0;
    --text-secondary: #c8c8d8;
    --text-muted: #b0b0c8;
    --text-light: #9090b0;
    --text-lighter: #707090;
    --border-light: rgba(80, 80, 120, 0.4);
    --border-medium: rgba(80, 80, 120, 0.6);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-nav: 0 6px 30px rgba(0, 0, 0, 0.5);
    --accent: #7ab84d;
    --accent-hover: #9cd668;
    --accent2: #6a8ac0;
    --badge-bg: rgba(100, 100, 140, 0.4);
    --badge-text: #c0c0d8;
    --toast-bg: rgba(200, 200, 220, 0.9);
    --toast-text: #1a1a2e;
}

/* ===== Base Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== Body & Background ===== */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--custom-bg-color, #ffffff);
    background-image: var(--custom-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    transition: background-color 0.3s ease;
    color: var(--text-primary);
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    z-index: 0;
    pointer-events: none;
}

/* ===== Page Wrapper ===== */
.page-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 100px;
}

/* ===== Fixed Navigation Bar ===== */
.bf-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1100px;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px 20px;
    background: var(--nav-bg);
    border-radius: 20px;
    padding: 14px 24px;
    box-shadow: var(--shadow-nav);
    border: 1px solid var(--border-light);
    border-bottom: 4px solid var(--accent);
    backdrop-filter: blur(4px);
    transition: transform var(--transition-smooth),
                opacity var(--transition-smooth),
                background-color 0.3s ease;
}
.bf-nav.nav-hidden {
    transform: translate(-50%, -110%);
    opacity: 0;
    pointer-events: none;
}
.bf-nav .nav-left { display: flex; align-items: center; gap: 20px; }
.bf-nav .nav-left a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s;
    position: relative;
}
.bf-nav .nav-left a:hover { color: var(--accent); }
.bf-nav .nav-left a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}
.bf-nav .nav-right { display: flex; align-items: center; gap: 12px; }
.bf-nav .nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: none;
    text-decoration: none;
    flex-shrink: 0;
    outline: none;
}
.bf-nav .nav-btn:hover { background: linear-gradient(135deg, var(--accent-hover), #2a4a7e); transform: scale(1.05); }
.bf-nav .nav-btn:active { transform: scale(0.95); }
.bf-nav .settings-btn { background: #6a6a8a; }
.bf-nav .settings-btn:hover { background: #4a4a6a; }
.bf-nav .login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 12px rgba(91, 140, 58, 0.35);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    outline: none;
    white-space: nowrap;
}
.bf-nav .login-btn:hover { filter: brightness(1.1); transform: scale(1.05); box-shadow: 0 6px 16px rgba(91, 140, 58, 0.5); }
.bf-nav .login-btn:active { transform: scale(0.96); }

/* ===== Main Container ===== */
.container {
    background: var(--container-bg);
    border-radius: 28px;
    padding: 40px 55px 50px;
    width: 100%;
    box-shadow: var(--shadow-card);
    text-align: center;
    border: 1px solid var(--border-light);
    backdrop-filter: blur(4px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* ===== Toast ===== */
.bf-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--toast-bg);
    color: var(--toast-text);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    body { padding: 10px; }
    .page-wrapper { padding-top: 90px; }
    .bf-nav { top: 10px; padding: 10px 16px; gap: 8px; }
    .bf-nav .nav-left { gap: 12px; }
    .bf-nav .nav-left a { font-size: 13px; }
    .bf-nav .nav-btn, .bf-nav .login-btn { width: 32px; height: 32px; font-size: 11px; }
    .container { padding: 25px 20px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
