/* Netflix Style Category Menu */

/* --- Container (FullScreen Overlay) --- */
#academic-categories-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    /* Deep dark background */
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}

#academic-categories-container.hidden {
    display: none !important;
}

/* --- Main Grid Wrapper (The "Window") --- */
.honeycomb-grid {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    /* Remove border and background for a cleaner look, or keep subtle */
    background: transparent;
    border: none;
    box-shadow: none;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    /* Start from top */
    gap: 20px;

    overflow-y: auto;
    padding: 60px 20px 40px 20px;
    /* Top padding for Close Button */

    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #ffd700 #222;
}

.honeycomb-grid::-webkit-scrollbar {
    width: 8px;
}

.honeycomb-grid::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.honeycomb-grid::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

/* --- Close Button --- */
.close-modal-btn {
    position: fixed;
    /* Fixed viewport positioning */
    top: 25px;
    /* More space from top */
    right: 25px;
    /* More space from right */
    width: 50px;
    /* Larger hit area */
    height: 50px;
    background: #e50914;
    /* Netflix Red */
    border: 3px solid #fff;
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10005;
    /* Higher than everything */
    transition: transform 0.2s, background 0.2s;
}

.close-modal-btn:hover {
    transform: scale(1.1);
    background: #ff0f1f;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.8);
}

/* --- Category Cards (Rectangular / Poster Style) --- */
.honeycomb-cell {
    /* Reset Hexagon properties */
    clip-path: none !important;
    width: 200px;
    height: 280px;
    /* Portrait aspect ratio */
    margin: 0;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.8) 0%, rgba(10, 10, 10, 1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    /* Slight roundness */

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;

    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Hover Effect: Scale Up like Netflix */
.honeycomb-cell:hover {
    transform: scale(1.1);
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border-color: #ffd700;
    background: linear-gradient(180deg, rgba(50, 50, 50, 0.9) 0%, rgba(20, 20, 20, 1) 100%);
}

.honeycomb-cell::before {
    display: none;
    /* Remove old hex before */
}

/* Icon & Text Styling */
.honeycomb-cell .icon {
    font-size: 3.5rem;
    margin-bottom: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transition: transform 0.3s;
}

.honeycomb-cell:hover .icon {
    transform: scale(1.1);
}

.honeycomb-cell .cat-name {
    font-family: 'Cinzel', serif;
    /* More premium font for headers */
    font-size: 1rem;
    color: #e5e5e5;
    text-transform: uppercase;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    width: 90%;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.honeycomb-cell:hover .cat-name {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .honeycomb-grid {
        padding: 50px 10px 20px 10px;
        gap: 15px;
    }

    .honeycomb-cell {
        width: 140px;
        /* Smaller width for mobile */
        height: 200px;
    }

    .honeycomb-cell .icon {
        font-size: 2.5rem;
    }

    .close-modal-btn {
        right: 20px;
        top: 10px;
    }
}

/* Ensure Toggle Button stays styled */
.toggler-container {
    width: 100%;
    text-align: center;
    margin: 30px 0;
    position: relative;
    z-index: 10;
}

#toggle-cats-btn {
    background: linear-gradient(45deg, #ff00cc, #333399, #00c6ff);
    background-size: 200% 200%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 18px 50px;
    font-size: 1.4rem;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 198, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

#toggle-cats-btn::before {
    content: '★';
    margin-right: 10px;
    color: #ffd700;
    filter: drop-shadow(0 0 5px #ffd700);
}

#toggle-cats-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 0 40px rgba(0, 198, 255, 0.9), 0 0 20px rgba(255, 0, 204, 0.6);
    border-color: #fff;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* --- Special Modes Grid (Restored & Fixed) --- */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Force 2 columns */
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
    justify-items: center;
}

.featured-grid .special-category-container {
    margin: 0 !important;
    width: 100%;
    display: flex;
    justify-content: center;
}

.featured-grid .special-wheel-btn,
.featured-grid .category-card {
    width: 100%;
    max-width: 350px;
    height: 100%;
    /* Match height in grid */
}

/* Ensure 2 columns even on mobile if possible, or stack on very small screens */
@media (max-width: 480px) {
    .featured-grid {
        grid-template-columns: 1fr;
        /* Only stack on very small screens */
    }
}