/* ============================================
   MINECRAFT CHEST GUI FOR MKDOCS
   6x9 Slot Grid with Original Inventory Colors
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* ============================================
   CSS VARIABLES (Original Dark Style)
   ============================================ */
:root {
    /* Container (Dark Gradient like inventory) */
    --chest-container-top: #3c3c3c;
    --chest-container-bottom: #1f1f1f;
    --chest-container-border: #000;
    --chest-shadow-light: #5e5e5e;
    --chest-shadow-dark: #1a1a1a;

    /* Slots */
    --chest-slot-bg: #222;
    --chest-slot-border: #5a5a5a;
    --chest-slot-border-light: #aaa;
    --chest-slot-border-dark: #111;

    /* Hover Effect (Red Glow) */
    --chest-primary-red: #d12e2e;

    /* Tooltip */
    --chest-tooltip-bg: rgba(16, 0, 16, 0.95);
    --chest-tooltip-border-top: #5d28b0;
    --chest-tooltip-border-bottom: #2a0e66;
    --chest-tooltip-title: #ffaaaa;
    --chest-tooltip-lore: #55FF55;
    --chest-text-shadow: #3f3f3f;
}

/* ============================================
   CHEST CONTAINER (Dark Gradient)
   ============================================ */
.mc-chest-gui {
    background: linear-gradient(180deg, var(--chest-container-top) 0%, var(--chest-container-bottom) 100%);
    padding: 10px;
    border: 4px solid var(--chest-container-border);
    box-shadow: inset 2px 2px 0px var(--chest-shadow-light),
    inset -2px -2px 0px var(--chest-shadow-dark),
    0 10px 20px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    display: inline-block;
    font-family: 'VT323', monospace;
    user-select: none;
    margin: 20px auto;
}

/* ============================================
   HEADER
   ============================================ */
.mc-chest-header {
    color: #aaa;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    margin-left: 2px;
    text-shadow: 1px 1px 0 var(--chest-container-border);
}

/* ============================================
   GRID (6 rows x 9 columns = 54 slots)
   ============================================ */
.mc-chest-grid {
    display: grid;
    grid-template-columns: repeat(9, 45px);
    grid-template-rows: repeat(6, 45px);
    gap: 4px;
}

/* ============================================
   SLOT STYLING (3D Effect like inventory)
   ============================================ */
.mc-chest-slot {
    width: 45px;
    height: 45px;
    background: var(--chest-slot-bg);
    border: 2px solid var(--chest-slot-border);
    border-right-color: var(--chest-slot-border-light);
    border-bottom-color: var(--chest-slot-border-light);
    border-left-color: var(--chest-slot-border-dark);
    border-top-color: var(--chest-slot-border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
    box-sizing: border-box;
}

/* ============================================
   HOVER EFFECT (Red Glow on ALL slots)
   ============================================ */
.mc-chest-slot:hover {
    background: #333;
    box-shadow: inset 0 0 10px var(--chest-primary-red);
    border-color: var(--chest-primary-red);
    z-index: 2;
}

/* ============================================
   ITEM IMAGE
   ============================================ */
.mc-item-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    pointer-events: none;
    transition: 0.2s;
    filter: drop-shadow(2px 2px 0 #000);
}

.mc-chest-slot:hover .mc-item-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px var(--chest-primary-red));
}

/* ============================================
   TOOLTIP (Minecraft Style with Purple Border)
   Only show on slots WITH items (has .mc-item-icon)
   ============================================ */
.mc-chest-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--chest-tooltip-bg);
    border: 2px solid var(--chest-tooltip-border-bottom);
    border-image: linear-gradient(to bottom, var(--chest-tooltip-border-top), var(--chest-tooltip-border-bottom)) 1;
    color: #fff;
    padding: 10px;
    min-width: 200px;
    max-width: 300px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    box-shadow: 0 5px 15px #000;
    font-family: 'VT323', monospace;
    visibility: hidden;
}

/* Only show tooltip on slots that have an item */
.mc-chest-slot:has(.mc-item-icon):hover .mc-chest-tooltip {
    opacity: 1;
    bottom: 115%;
    transform: translateX(-50%) scale(1);
    visibility: visible;
}

/* ============================================
   TOOLTIP CONTENT
   ============================================ */
.mc-tooltip-title {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: var(--chest-tooltip-title);
    text-shadow: 2px 2px 0 var(--chest-text-shadow);
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

.mc-tooltip-lore {
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    color: var(--chest-tooltip-lore);
    text-shadow: 2px 2px 0 var(--chest-text-shadow);
    line-height: 1.3;
    display: block;
}

/* ============================================
   CLICKABLE SLOTS
   ============================================ */
.mc-chest-slot[data-link] {
    cursor: pointer;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .mc-chest-grid {
        grid-template-columns: repeat(9, 35px);
        grid-template-rows: repeat(6, 35px);
        gap: 3px;
    }

    .mc-chest-slot {
        width: 35px;
        height: 35px;
    }

    .mc-item-icon {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   CENTER ALIGNMENT HELPER
   ============================================ */
.mc-chest-center {
    text-align: center;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

html {
    scroll-behavior: smooth;
}