/* ============================================
   MODERN DARK MINECRAFT GUI FOR MKDOCS
   Glassmorphism + Dark Mode + Rounded Corners
   ============================================ */

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

/* ============================================
   CSS VARIABLES (Modern Dark Theme)
   ============================================ */
:root {
    /* Container (Glassmorphic Dark) */
    --mc-dark-bg: rgba(30, 30, 35, 0.85);
    --mc-dark-border: rgba(255, 255, 255, 0.1);
    --mc-accent-glow: rgba(255, 50, 50, 0.3);

    /* Slots */
    --mc-slot-bg: rgba(0, 0, 0, 0.3);
    --mc-slot-border: rgba(255, 255, 255, 0.05);
    --mc-slot-hover: rgba(255, 255, 255, 0.1);

    /* Tooltip */
    --mc-tt-bg: rgba(10, 10, 15, 0.95);
    --mc-tt-border: #6d28d9; /* Deep Purple */
}

/* ============================================
   CHEST CONTAINER (Modern Dark)
   ============================================ */
.mc-chest-gui {
    background: var(--mc-dark-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
    border: 1px solid var(--mc-dark-border);
    border-radius: 16px; /* Modern Rounded Corners */
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: inline-block;
    font-family: 'VT323', monospace;
    user-select: none;
    margin: 30px auto;
    position: relative;
    /* overflow: hidden removed to allow tooltips to pop out */
}

/* ============================================
   HEADER
   ============================================ */
.mc-chest-header {
    color: #efefef;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 15px;
    margin-left: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ============================================
   GRID
   ============================================ */
.mc-chest-grid {
    display: grid;
    grid-template-columns: repeat(9, 48px);
    grid-template-rows: repeat(auto-fill, 48px);
    gap: 8px; /* Modern spacing */
}

/* ============================================
   MODERN SLOT STYLING
   ============================================ */
.mc-chest-slot {
    width: 48px;
    height: 48px;
    background: var(--mc-slot-bg);
    border: 1px solid var(--mc-slot-border);
    border-radius: 10px; /* Rounded individual slots */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* ============================================
   MODERN HOVER EFFECT
   ============================================ */
.mc-chest-slot:hover {
    background: var(--mc-slot-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100; /* Ensure hovered slot and its tooltip are above EVERYTHING */
}

/* Red accent for specific interactive elements if needed, 
   otherwise subtle white/blue glow is more "modern" */
.mc-chest-slot[data-link]:hover {
    box-shadow: 0 0 15px var(--mc-accent-glow);
    border-color: rgba(255, 50, 50, 0.4);
}

/* ============================================
   ITEM IMAGE
   ============================================ */
.mc-item-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transition: transform 0.2s ease;
}

.mc-chest-slot:hover .mc-item-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   TOOLTIP (Modern Sleek)
   ============================================ */
.mc-chest-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--mc-tt-bg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--mc-tt-border); /* Accent edge */
    color: #fff;
    padding: 12px 18px;
    width: max-content; /* Prevent extreme wrapping */
    min-width: 150px;
    max-width: 450px; /* Increased room */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    visibility: hidden;
    white-space: normal;
}

.mc-chest-slot:has(.mc-item-icon):hover .mc-chest-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    visibility: visible;
}

/* ============================================
   TOOLTIP CONTENT
   ============================================ */
.mc-tooltip-title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.mc-tooltip-lore {
    color: #a1a1aa;
    font-size: 0.95rem;
    display: block;
    line-height: 1.4;
    font-family: 'Inter', sans-serif; /* Modern font for lore */
}

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

    .mc-chest-slot {
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }

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

.mc-chest-center {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 40px 0;
}

/* Add a subtle animation to the background */
@keyframes pulseGlow {
    0% { opacity: 0.4; }
    50% { opacity: 0.6; }
    100% { opacity: 0.4; }
}

.mc-chest-gui::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, var(--mc-accent-glow) 0%, transparent 70%);
    z-index: -1;
    animation: pulseGlow 4s infinite ease-in-out;
}
