:root {
    --bg-dark: #121212;
    --panel-bg: #1e1e1e;
    --panel-border: #4a4a4a;
    --text-main: #e0e0e0;
    --text-highlight: #ffca28;
    --slot-bg: #2c2c2c;
    --slot-border: #3d3d3d;
    --slot-hover: #454545;
    --tab-bg: #2a2a2a;
    --tab-active: #3a3a3a;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Optional grid pattern to look more like a digital UI */
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.inventory-container {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background-color: var(--panel-bg);
    border: 3px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inventory-header {
    padding: 20px;
    background: linear-gradient(to bottom, #2a2a2a, #1e1e1e);
    border-bottom: 2px solid var(--panel-border);
    text-align: center;
}

.inventory-header h1 {
    font-family: 'Cinzel', serif;
    color: var(--text-highlight);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-size: 2em;
    letter-spacing: 2px;
}

.inventory-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.tabs {
    width: 200px;
    background-color: #1a1a1a;
    border-right: 2px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.tab {
    padding: 15px 20px;
    background: var(--tab-bg);
    color: var(--text-main);
    border: none;
    border-bottom: 1px solid #111;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab:hover {
    background: var(--slot-hover);
}

.tab.active {
    background: var(--tab-active);
    color: var(--text-highlight);
    border-left: 4px solid var(--text-highlight);
}

.inventory-grid-container {
    flex: 1;
    padding: 20px;
    background-color: #151515;
    overflow-y: auto;
    container-type: inline-size; /* Enables container queries on child grids */
}

.inventory-grid {
    display: none;
    grid-template-columns: 1fr; /* Default: single column on very small containers */
    gap: 15px;
    align-content: start;
}

/* Grow to 2 columns once the grid container is wide enough for two items */
@container (min-width: 280px) {
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Cap at 3 columns — never exceeds this */
@container (min-width: 420px) {
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.inventory-grid.active-grid {
    display: grid;
}

.item-slot {
    aspect-ratio: 1;
    background-color: var(--slot-bg);
    border: 2px solid var(--slot-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.item-slot:hover:not(.empty) {
    transform: scale(1.05);
    border-color: var(--text-highlight);
    box-shadow: 0 0 15px rgba(255, 202, 40, 0.4);
    z-index: 10;
}

.item-slot.empty {
    background-color: #222;
    border-color: #333;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    cursor: default;
}

.item-icon {
    width: 80%;
    height: 60%;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.item-name {
    font-size: 0.85em;
    text-align: center;
    font-weight: 500;
}

/* Specific item thumbnail background */
.scene-1-1 {
    background-image: url('../Images/scene_1_1/DCC_1_1_thumbnail.webp');
}

.scene-1-3 {
    background-image: url('../Images/scene_1_3/DCC_1_3_thumbnail.webp');
}

.scene-1-9 {
    background-image: url('../Images/scene_1_9/DCC_1_9_thumbnail.webp');
}

.scene-1-28 {
    background-image: url('../Images/scene_1_28/DCC_1_28_thumbnail.webp');
}

.scene-2-6 {
    background-image: url('../Images/scene_2_6/DCC_2_6_thumbnail.webp');
}

.scene-2-15 {
    background-image: url('../Images/scene_2_15/DCC_2_15_thumbnail.webp');
}

.scene-2-24 {
    background-image: url('../Images/scene_2_24/DCC_2_24_thumbnail.webp');
}

.scene-3-2 {
    background-image: url('../Images/scene_3_2/DCC_3_2_thumbnail.webp');
}

.scene-3-4 {
    background-image: url('../Images/scene_3_4/DCC_3_4_thumbnail.webp');
}

.scene-3-20 {
    background-image: url('../Images/scene_3_20/DCC_3_20_thumbnail.webp');
}

.scene-4-3 {
    background-image: url('../Images/scene_4_3/DCC_4_3_thumbnail.webp');
}

.scene-4-20 {
    background-image: url('../Images/scene_4_20/DCC_4_20_thumbnail.webp');
}

.scene-4-33 {
    background-image: url('../Images/scene_4_33/DCC_4_33_thumbnail.webp');
}

.scene-5-25 {
    background-image: url('../Images/scene_5_25/DCC_5_25_thumbnail.webp');
}

.scene-5-2 {
    background-image: url('../Images/scene_5_2/DCC_5_2_thumbnail.webp');
}

.scene-5-17 {
    background-image: url('../Images/scene_5_17/DCC_5_17_thumbnail.webp');
}

.scene-5-65 {
    background-image: url('../Images/scene_5_65/DCC_5_65_thumbnail.webp');
}

.scene-5-e {
    background-image: url('../Images/scene_5_e/DCC_5_e_thumbnail.webp');
}

.scene-6-2 {
    background-image: url('../Images/scene_6_2/DCC_6_2_thumbnail.webp');
}

.scene-6-10 {
    background-image: url('../Images/scene_6_10/DCC_6_10_thumbnail.webp');
}

.scene-6-24 {
    background-image: url('../Images/scene_6_24/DCC_6_24_thumbnail.webp');
}

.scene-7-7 {
    background-image: url('../Images/scene_7_7/DCC_7_7_thumbnail.webp');
}

.scene-7-12 {
    background-image: url('../Images/scene_7_12/DCC_7_12_thumbnail.webp');
}

.scene-7-50 {
    background-image: url('../Images/scene_7_50/DCC_7_50_thumbnail.webp');
}

/* --- SPOTIFY PLAYER --- */
.spotify-bar {
    width: 100%;
    border-top: 1px solid var(--panel-border);
    background: #0d0d0d;
    flex-shrink: 0;
}

.spotify-bar iframe {
    display: block;
    width: 100%;
    height: 80px;
    border: none;
    border-radius: 0;
}

/* --- ADVERTISING SLOTS --- */
/* Both slots are fixed to the viewport so they sit outside the inventory panel */
.ad-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 728px;
    height: 90px;
    z-index: 100;
    background: rgba(20, 20, 20, 0.9);
    border: 1px dashed #444;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.75em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ad-banner-side {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 100;
    background: rgba(20, 20, 20, 0.9);
    border: 1px dashed #444;
    border-right: none;
    border-radius: 4px 0 0 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.75em;
    letter-spacing: 1px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* --- PLAYLIST & SELECT MODE --- */
.mode-toggle {
    margin: 15px;
    padding: 12px 16px;
    background: #1a1a1a;
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.mode-toggle:hover {
    background: #252525;
    border-color: var(--text-highlight);
    color: var(--text-highlight);
}

.mode-toggle.active {
    background: rgba(255, 202, 40, 0.1);
    color: var(--text-highlight);
    border-color: var(--text-highlight);
    box-shadow: 0 0 10px rgba(255, 202, 40, 0.2);
}

/* --- INFO PANEL --- */
.info-panel {
    gap: 20px;
    padding: 10px 5px 20px 5px;
}

.info-panel.active-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
}

.info-card {
    background-color: var(--slot-bg);
    border: 2px solid var(--slot-border);
    border-radius: 6px;
    padding: 22px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
    flex: 0 0 85%;
    max-width: 450px;
    scroll-snap-align: start;
}

.info-card h2 {
    font-family: 'Cinzel', serif;
    color: var(--text-highlight);
    margin-bottom: 12px;
    font-size: 1.35em;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 8px;
    letter-spacing: 1px;
}

.info-card p, .info-card ul {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    font-size: 0.95em;
    line-height: 1.6;
}

.info-card ul {
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 8px;
}

.playlist-controls {
    background: #151515;
    border-top: 2px solid var(--panel-border);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-controls.hidden {
    display: none;
}

.playlist-controls select {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: 10px;
}

.start-btn {
    background: #2d5a27;
    color: #fff;
    border: 1px solid #4CAF50;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.start-btn:hover:not(:disabled) {
    background: #3e8e41;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.start-btn:disabled {
    background: #333;
    border-color: #555;
    color: #777;
    cursor: not-allowed;
}

/* Selected Slot State */
.item-slot.selected {
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
    background-color: rgba(76, 175, 80, 0.1);
}
.item-slot.selected::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4CAF50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Hide ad banners on mobile screens (both portrait and landscape) */
@media (max-width: 992px), (max-height: 600px) {
    .ad-banner-bottom,
    .ad-banner-side {
        display: none !important;
    }
}

/* Email link styling */
#email-link a {
    color: var(--text-highlight);
    text-decoration: none;
    border-bottom: 1px dashed var(--text-highlight);
    transition: color 0.2s, border-bottom-color 0.2s, text-shadow 0.2s;
}

#email-link a:hover {
    color: #fff;
    border-bottom-color: #fff;
    text-shadow: 0 0 8px rgba(255, 202, 40, 0.6);
}

/* --- CUSTOM SCROLLBARS --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark); 
}
::-webkit-scrollbar-thumb {
    background: var(--panel-border); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-highlight); 
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .inventory-container {
        width: 95%;
        height: 90vh;
    }

    .inventory-header {
        padding: 15px 10px;
    }

    .inventory-header h1 {
        font-size: 1.4em;
    }

    .inventory-body {
        flex-direction: column;
    }

    .tabs {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 2px solid var(--panel-border);
        overflow-x: auto;
        overflow-y: hidden;
        flex-shrink: 0;
    }

    .tab {
        flex: 0 0 auto;
        border-bottom: none;
        border-right: 1px solid #111;
        padding: 12px 16px;
    }

    .tab.active {
        border-left: none;
        border-bottom: 4px solid var(--text-highlight);
    }

    .sidebar-spacer {
        display: none;
    }

    .mode-toggle {
        flex: 0 0 auto;
        margin: 8px;
    }
}


