/* Base Layout Cloned from style.css but with Fantasy Variables */
:root {
    --bg-color: #1a1510;
    --text-color: #f0e6d2;
    --header-bg: #110d0a;
    --border-color: #5c4d3c;
    --accent-color: #d4af37;
    --secondary-color: #8b0000;
    --dim-color: #8b7355;
    --card-bg: #2b2218;
    /* Extra var for Fantasy cards */
    --border-style: 1px double var(--border-color);
    /* Double border for fantasy feel */
    --sidebar-width: 280px;
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

body {
    margin: 0;
    font-family: 'Cinzel', serif;
    background: #1a1510 url('/foba-helper/scenario/img/parchment_bg.jpg');
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

input,
button,
select,
textarea {
    font-family: 'Cinzel', serif;
    background-color: var(--card-bg);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

h1,
h2,
h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-color);
    text-transform: uppercase;
    border-bottom: 2px double var(--accent-color);
    /* Double border */
    padding-bottom: 5px;
    text-shadow: 1px 1px 0 #000;
}

/* Layout */
.container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr 350px;
    grid-template-rows: 60px 1fr 40px;
    height: 100vh;
    gap: 0;
}

/* Header */
.header {
    grid-column: 1 / -1;
    border-bottom: var(--border-style);
    background: var(--header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-left: 50px;
}

/* Sidebar */
.sidebar {
    grid-row: 2 / 3;
    border-right: var(--border-style);
    background: var(--header-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.nav-btn {
    background: rgba(43, 34, 24, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 4px;
}

.nav-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

.nav-btn.active {
    background: var(--accent-color);
    color: #000;
    font-weight: bold;
    border-color: var(--accent-color);
}

/* Main Content */
.main-content {
    grid-row: 2 / 3;
    background: transparent;
    /* Let body bg show */
    padding: 20px;
    overflow-y: auto;
    position: relative;
    border-right: var(--border-style);
}

.node-card {
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(43, 34, 24, 0.8);
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.node-card h3 {
    border: none;
    padding: 0;
    margin-top: 0;
}

.node-card.locked {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1) sepia(0.5);
    border-style: dashed;
}

.clue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.clue-item:hover {
    background: rgba(212, 175, 55, 0.05);
}

.clue-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.clue-checkbox:checked {
    background: var(--accent-color);
}

.clue-checkbox:checked::after {
    content: '✖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 14px;
    font-weight: bold;
}

/* Right Panel */
.status-panel {
    grid-row: 2 / 3;
    background: var(--header-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.progress-module {
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 4px;
}

.bar-container {
    height: 10px;
    background: #221b14;
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #333;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b8860b, #ffd700);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 5px #ffd700;
}

/* Footer */
.footer {
    grid-column: 1 / -1;
    border-top: var(--border-style);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--dim-color);
    background: var(--header-bg);
}

.hidden {
    display: none !important;
}

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    border: 1px solid var(--border-color);
    padding: 15px;
    background: rgba(43, 34, 24, 0.8);
    border-radius: 4px;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

/* Badges */
.badged {
    display: inline-block;
    padding: 2px 8px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 2px;
    margin-left: 10px;
    letter-spacing: 1px;
    border: 1px solid #f00;
}

.tag {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--dim-color);
    border: 1px solid var(--dim-color);
    padding: 1px 6px;
    border-radius: 10px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.tier-badge {
    background: var(--text-color);
    color: var(--bg-color);
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.8rem;
    float: right;
}

.rewards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.loot {
    color: #ffd700;
    text-shadow: 0 0 3px #ffd700;
    font-weight: bold;
}

.cost {
    color: #ffd700;
    font-weight: bold;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* IMPORTANT: Tab Logic - Fade In */
.tab-content {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile (IDENTICAL STRUCTURE to style.css) */
@media (max-width: 899px) {
    .container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    .header {
        flex-shrink: 0;
        height: 60px;
        padding-left: 10px;
    }

    .logo {
        margin-left: 40px;
        font-size: 1rem;
    }

    /* Sidebar matching Cyberpunk structure exactly */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        z-index: 99;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        padding-top: 70px;
        display: flex;
        flex-direction: column;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .nav-btn {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    .main-content {
        flex-grow: 1;
        overflow-y: auto;
        padding: 15px;
    }

    .status-panel {
        display: none;
    }

    .footer {
        display: none;
    }

    /* Fantasy Specific Mobile Overrides (optional, but keeping structure clean) */
    .scenario-header {
        position: sticky;
        top: 0;
        z-index: 3000;
        background: var(--header-bg);
        border-bottom: 1px double var(--accent-color);
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}