/* ===============================================
   MINECRAFT THEME - Security Challenges
   =============================================== */

/* Import Minecraft-style fonts - Optimized for readability */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ===============================================
   CSS Variables - Minecraft Color Palette
   =============================================== */
:root {
    /* Core Minecraft colors */
    --mc-grass-green: #5D9B47;
    --mc-grass-dark: #4A7A38;
    --mc-grass-light: #7CBD5D;
    --mc-dirt-brown: #8B6B4F;
    --mc-dirt-dark: #6B5344;
    --mc-stone-gray: #7F7F7F;
    --mc-stone-dark: #5F5F5F;
    --mc-cobblestone: #6B6B6B;
    --mc-wood-brown: #9C7248;
    --mc-wood-dark: #6B4D2D;
    --mc-wood-light: #BC9268;
    --mc-leaves-green: #4CA04C;
    --mc-sky-blue: #87CEEB;
    --mc-water-blue: #3F76E4;
    --mc-lava-orange: #FF6600;
    --mc-gold: #FCDB05;
    --mc-diamond: #4AEDD9;
    --mc-emerald: #17DD62;
    --mc-redstone: #FF0000;
    --mc-obsidian: #1B1B1B;
    --mc-netherrack: #6F3535;
    --mc-endstone: #DBDE8E;
    --mc-torch-orange: #FFAA00;
    --mc-xp-green: #7FFF00;

    /* UI Colors */
    --mc-bg-dark: #1D1D1D;
    --mc-bg-panel: #2D2D2D;
    --mc-text-light: #E0E0E0;
    --mc-text-dark: #1A1A1A;
    --mc-border: #373737;
    --mc-border-light: #5A5A5A;

    /* Difficulty colors */
    --mc-beginner: #5D9B47;
    --mc-easy: #7CB342;
    --mc-medium: #FCDB05;
    --mc-hard: #FF6600;
    --mc-expert: #FF0000;
}

/* ===============================================
   Base Styles
   =============================================== */
html, body {
    font-family: 'Space Grotesk', 'VT323', monospace;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--mc-bg-dark);
    color: var(--mc-text-light);
    image-rendering: pixelated;
    overflow-x: hidden;
}

/* Animated Minecraft night sky background */
body {
    background:
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1px, transparent 1px),
        linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #2d1f3d 100%);
    background-size: 100px 100px, 150px 150px, 100% 100%;
    background-position: 0 0, 50px 50px, 0 0;
    animation: starfield 60s linear infinite;
}

@keyframes starfield {
    0% { background-position: 0 0, 50px 50px, 0 0; }
    100% { background-position: 100px 100px, 150px 150px, 0 0; }
}

/* Floating particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(125, 189, 93, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(74, 237, 217, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(252, 219, 5, 0.05) 0%, transparent 30%);
    animation: ambient-glow 8s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes ambient-glow {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Press Start 2P', monospace;
    color: var(--mc-gold);
    text-shadow: 3px 3px 0px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4, h5, h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
}

a {
    color: var(--mc-diamond);
    text-decoration: none;
    transition: all 0.1s;
}

a:hover {
    color: var(--mc-gold);
    text-shadow: 0 0 8px var(--mc-gold);
}

/* ===============================================
   Minecraft-style Buttons
   =============================================== */
.btn, button:not(.navbar-toggler) {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border: 4px solid;
    border-radius: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.1s;
    position: relative;
    cursor: pointer;
}

.btn:hover {
    animation: btn-hover 0.1s ease;
}

@keyframes btn-hover {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Stone button style (default) */
.btn-primary, .btn {
    background: linear-gradient(180deg, #8B8B8B 0%, #6B6B6B 50%, #5B5B5B 100%);
    border-color: #ABABAB #4B4B4B #4B4B4B #ABABAB;
    color: var(--mc-text-light);
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

.btn-primary:hover, .btn:hover {
    background: linear-gradient(180deg, #9B9B9B 0%, #7B7B7B 50%, #6B6B6B 100%);
    border-color: #BBBBBB #5B5B5B #5B5B5B #BBBBBB;
    color: var(--mc-gold);
}

.btn-primary:active, .btn:active {
    background: linear-gradient(180deg, #5B5B5B 0%, #4B4B4B 50%, #3B3B3B 100%);
    border-color: #3B3B3B #7B7B7B #7B7B7B #3B3B3B;
    transform: scale(0.98);
}

/* Success button - Emerald style */
.btn-success {
    background: linear-gradient(180deg, #2ECC71 0%, #17DD62 50%, #14A85A 100%);
    border-color: #5DFFAA #0A6B35 #0A6B35 #5DFFAA;
    color: var(--mc-text-dark);
    text-shadow: 1px 1px 0px rgba(255,255,255,0.3);
}

.btn-success:hover {
    background: linear-gradient(180deg, #3EDD81 0%, #27ED72 50%, #24B86A 100%);
    border-color: #6DFFBA #1A7B45 #1A7B45 #6DFFBA;
    color: var(--mc-text-dark);
    box-shadow: 0 0 20px rgba(23, 221, 98, 0.5);
}

/* Warning button - Gold style */
.btn-warning {
    background: linear-gradient(180deg, #FFE44D 0%, #FCDB05 50%, #D4B800 100%);
    border-color: #FFF380 #9A8500 #9A8500 #FFF380;
    color: var(--mc-text-dark);
    text-shadow: 1px 1px 0px rgba(255,255,255,0.3);
}

.btn-warning:hover {
    background: linear-gradient(180deg, #FFF060 0%, #FFE520 50%, #E4C810 100%);
    color: var(--mc-text-dark);
    box-shadow: 0 0 20px rgba(252, 219, 5, 0.5);
}

/* Danger button - Redstone style */
.btn-danger {
    background: linear-gradient(180deg, #FF4444 0%, #FF0000 50%, #CC0000 100%);
    border-color: #FF8888 #880000 #880000 #FF8888;
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #FF5555 0%, #FF2222 50%, #DD1111 100%);
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    animation: redstone-pulse 0.5s ease infinite;
}

@keyframes redstone-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 0, 0.8); }
}

/* Secondary button - Cobblestone style */
.btn-secondary, .btn-outline-warning, .btn-outline-secondary {
    background: linear-gradient(180deg, #6B6B6B 0%, #5B5B5B 50%, #4B4B4B 100%);
    border-color: #8B8B8B #3B3B3B #3B3B3B #8B8B8B;
    color: var(--mc-text-light);
}

.btn-outline-warning {
    border-color: var(--mc-gold) !important;
}

.btn-outline-warning:hover {
    background: linear-gradient(180deg, #FFE44D 0%, #FCDB05 50%, #D4B800 100%);
    color: var(--mc-text-dark);
}

/* ===============================================
   Cards - Minecraft Inventory Panel Style
   =============================================== */
.card {
    background: linear-gradient(180deg, #3D3D3D 0%, #2D2D2D 100%);
    border: 4px solid;
    border-color: #5D5D5D #1D1D1D #1D1D1D #5D5D5D;
    border-radius: 0 !important;
    margin-bottom: 1.5rem;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer effect on cards */
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255,255,255,0.03) 50%,
        transparent 60%
    );
    animation: card-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes card-shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.card-header {
    background: linear-gradient(180deg, #4D4D4D 0%, #3D3D3D 100%);
    border-bottom: 4px solid var(--mc-border);
    border-radius: 0 !important;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--mc-gold);
    padding: 12px 16px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

.card-body {
    padding: 16px;
    position: relative;
    z-index: 1;
}

.card-body h5 {
    color: var(--mc-emerald);
    font-size: 11px;
    margin-top: 1rem;
}

/* Special card header colors */
.card-header.bg-success {
    background: linear-gradient(180deg, #2ECC71 0%, #17DD62 100%) !important;
    color: var(--mc-text-dark) !important;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.3) !important;
}

.card-header.bg-warning {
    background: linear-gradient(180deg, #FFE44D 0%, #FCDB05 100%) !important;
    color: var(--mc-text-dark) !important;
}

.card-header.bg-danger {
    background: linear-gradient(180deg, #FF4444 0%, #FF0000 100%) !important;
}

/* ===============================================
   Alerts - Minecraft Sign Style
   =============================================== */
.alert {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 500;
    border: 4px solid;
    border-radius: 0 !important;
    padding: 16px;
    line-height: 1.6;
}

.alert-warning {
    background: linear-gradient(180deg, var(--mc-wood-brown) 0%, var(--mc-wood-dark) 100%);
    border-color: #BFA07A #5A3D1D #5A3D1D #BFA07A;
    color: var(--mc-text-light);
}

.alert-success {
    background: linear-gradient(180deg, #2A5A2A 0%, #1A4A1A 100%);
    border-color: #4A8A4A #0A2A0A #0A2A0A #4A8A4A;
    color: var(--mc-emerald);
}

.alert-danger {
    background: linear-gradient(180deg, #5A2A2A 0%, #4A1A1A 100%);
    border-color: #8A4A4A #2A0A0A #2A0A0A #8A4A4A;
    color: #FF6666;
}

.alert-info {
    background: linear-gradient(180deg, #2A4A6A 0%, #1A3A5A 100%);
    border-color: #4A7AAA #0A2A4A #0A2A4A #4A7AAA;
    color: var(--mc-diamond);
}

/* ===============================================
   Form Controls - Minecraft Input Style
   =============================================== */
.form-control, input[type="text"], input[type="password"], input[type="email"], textarea, select {
    font-family: 'Space Grotesk', 'VT323', monospace;
    font-size: 16px;
    font-weight: 500;
    background: #1A1A1A;
    border: 4px solid;
    border-color: #0A0A0A #4A4A4A #4A4A4A #0A0A0A;
    border-radius: 0 !important;
    color: var(--mc-text-light);
    padding: 12px;
}

.form-control:focus, input:focus, textarea:focus, select:focus {
    background: #2A2A2A;
    border-color: var(--mc-emerald);
    box-shadow: 0 0 15px var(--mc-emerald), inset 0 0 10px rgba(23, 221, 98, 0.1);
    color: var(--mc-text-light);
    outline: none;
}

.form-control::placeholder {
    color: #6A6A6A;
}

/* Input group */
.input-group {
    border: none;
}

.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: 4px solid var(--mc-border);
}

/* ===============================================
   Badges - Minecraft Item Labels
   =============================================== */
.badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid;
    border-radius: 0 !important;
    padding: 5px 10px;
    text-transform: uppercase;
}

.badge.bg-warning, .bg-warning {
    background: var(--mc-gold) !important;
    border-color: #D4B800 !important;
    color: var(--mc-text-dark) !important;
}

.badge.bg-secondary, .bg-secondary {
    background: var(--mc-stone-gray) !important;
    border-color: var(--mc-stone-dark) !important;
}

.badge.bg-success, .bg-success {
    background: var(--mc-emerald) !important;
    border-color: #14A85A !important;
    color: var(--mc-text-dark) !important;
}

.badge.bg-danger, .bg-danger {
    background: var(--mc-redstone) !important;
    border-color: #CC0000 !important;
}

.badge.bg-info, .bg-info {
    background: var(--mc-diamond) !important;
    border-color: #3ADDC9 !important;
    color: var(--mc-text-dark) !important;
}

.badge.bg-primary, .bg-primary {
    background: var(--mc-water-blue) !important;
    border-color: #2F66D4 !important;
}

/* ===============================================
   Navigation - Minecraft Menu Style (IMPROVED)
   =============================================== */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ===============================================
   SIDEBAR - Much improved readability!
   =============================================== */
.sidebar {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-right: 4px solid #3a3a3a;
    position: relative;
    overflow: hidden;
}

/* Torch glow effect on sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    top: 60px;
    left: 10px;
    width: 100%;
    height: 200px;
    background: radial-gradient(ellipse at top left, rgba(255, 170, 0, 0.15) 0%, transparent 60%);
    pointer-events: none;
    animation: torch-flicker 2s ease-in-out infinite;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 300px;
    right: 10px;
    width: 100%;
    height: 200px;
    background: radial-gradient(ellipse at top right, rgba(255, 170, 0, 0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: torch-flicker 2.5s ease-in-out infinite reverse;
}

@keyframes torch-flicker {
    0%, 100% { opacity: 0.8; }
    25% { opacity: 1; }
    50% { opacity: 0.7; }
    75% { opacity: 0.95; }
}

.top-row {
    background: linear-gradient(180deg, #3D3D3D 0%, #2D2D2D 100%);
    border-bottom: 4px solid var(--mc-border);
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-row a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--mc-diamond);
    margin-left: 1.5rem;
}

.top-row a:hover {
    color: var(--mc-gold);
}

/* Nav brand - Minecraft title style */
.navbar-brand {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px !important;
    color: var(--mc-gold) !important;
    text-shadow:
        2px 2px 0px rgba(0,0,0,0.8),
        0 0 10px rgba(252, 219, 5, 0.3);
    letter-spacing: 1px;
    padding: 8px 0;
}

/* Top row in sidebar */
.sidebar .top-row {
    background: linear-gradient(180deg,
        var(--mc-grass-light) 0%,
        var(--mc-grass-green) 40%,
        var(--mc-grass-dark) 100%);
    border-bottom: 4px solid var(--mc-grass-dark);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
}

/* Nav items - IMPROVED */
.nav-item {
    margin: 2px 8px;
}

.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff !important;
    padding: 10px 16px !important;
    transition: all 0.15s;
    border: 2px solid transparent;
    background: rgba(0,0,0,0.2);
    margin: 2px 0;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.8);
}

.nav-link:hover {
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
    border-color: #5a5a5a #2a2a2a #2a2a2a #5a5a5a;
    color: var(--mc-gold) !important;
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--mc-gold);
}

.nav-link.active {
    background: linear-gradient(180deg, #3a5a3a 0%, #2a4a2a 100%);
    border-color: #5a8a5a #1a3a1a #1a3a1a #5a8a5a;
    color: var(--mc-emerald) !important;
    box-shadow:
        -4px 0 0 var(--mc-emerald),
        inset 0 0 20px rgba(23, 221, 98, 0.1);
}

/* Navbar toggler */
.navbar-toggler {
    border: 2px solid var(--mc-gold);
    border-radius: 0;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23FCDB05' stroke-linecap='square' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===============================================
   Tabs - Minecraft Crafting Style
   =============================================== */
.nav-tabs {
    border-bottom: 4px solid var(--mc-border);
}

.nav-tabs .nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(180deg, #4D4D4D 0%, #3D3D3D 100%);
    border: 4px solid;
    border-color: #6D6D6D #2D2D2D #2D2D2D #6D6D6D;
    border-radius: 0 !important;
    color: var(--mc-text-light) !important;
    margin-right: 4px;
    margin-bottom: -4px;
    padding: 10px 16px !important;
}

.nav-tabs .nav-link:hover {
    background: linear-gradient(180deg, #5D5D5D 0%, #4D4D4D 100%);
    color: var(--mc-gold) !important;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(180deg, #2D2D2D 0%, #1D1D1D 100%);
    border-color: #4D4D4D #1D1D1D #1D1D1D #4D4D4D;
    border-bottom-color: #1D1D1D;
    color: var(--mc-emerald) !important;
}

.tab-content {
    background: linear-gradient(180deg, #2D2D2D 0%, #1D1D1D 100%);
    border: 4px solid;
    border-color: #1D1D1D #4D4D4D #4D4D4D #1D1D1D;
    border-top: none;
}

/* ===============================================
   Code Blocks - Command Block Style
   =============================================== */
pre, code {
    font-family: 'VT323', monospace;
    font-size: 16px;
}

pre {
    background: linear-gradient(180deg, #2A1A1A 0%, #1A0A0A 100%);
    border: 4px solid;
    border-color: #4A3A3A #0A0000 #0A0000 #4A3A3A;
    border-radius: 0 !important;
    padding: 16px;
    color: #FF8866;
    position: relative;
    overflow: hidden;
}

/* Command block pulse effect */
pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255, 102, 0, 0.1) 0%, transparent 70%);
    animation: command-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes command-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

code {
    background: #2A1A1A;
    color: var(--mc-lava-orange);
    padding: 2px 6px;
    border-radius: 0;
}

.bg-dark {
    background: linear-gradient(180deg, #1A1A1A 0%, #0A0A0A 100%) !important;
}

.text-light {
    color: var(--mc-text-light) !important;
}

/* ===============================================
   Breadcrumbs - Minecraft Path
   =============================================== */
.breadcrumb {
    background: linear-gradient(180deg, #3D3D3D 0%, #2D2D2D 100%);
    border: 4px solid;
    border-color: #5D5D5D #1D1D1D #1D1D1D #5D5D5D;
    border-radius: 0 !important;
    padding: 12px 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--mc-diamond);
}

.breadcrumb-item.active {
    color: var(--mc-gold);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--mc-stone-gray);
}

/* ===============================================
   Lists
   =============================================== */
ul, ol {
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
}

.list-unstyled li {
    margin-bottom: 12px;
}

.list-unstyled a {
    display: block;
    padding: 8px 12px;
    background: rgba(0,0,0,0.2);
    border-left: 4px solid var(--mc-emerald);
    transition: all 0.1s;
}

.list-unstyled a:hover {
    background: rgba(0,0,0,0.4);
    border-left-color: var(--mc-gold);
    padding-left: 16px;
}

/* ===============================================
   Details/Summary - Chest Opening Style
   =============================================== */
details {
    background: rgba(0,0,0,0.2);
    border: 2px solid var(--mc-wood-brown);
    padding: 8px;
    margin: 8px 0;
}

details[open] {
    animation: chest-open 0.3s ease;
}

@keyframes chest-open {
    0% { transform: scaleY(0.8); opacity: 0.5; }
    100% { transform: scaleY(1); opacity: 1; }
}

summary {
    cursor: pointer;
    color: var(--mc-diamond);
    font-size: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
}

summary:hover {
    color: var(--mc-gold);
}

/* ===============================================
   Difficulty Badges
   =============================================== */
.challenge-difficulty-beginner {
    color: var(--mc-beginner) !important;
}

.challenge-difficulty-easy {
    color: var(--mc-easy) !important;
}

.challenge-difficulty-medium {
    color: var(--mc-medium) !important;
}

.challenge-difficulty-hard {
    color: var(--mc-hard) !important;
}

.challenge-difficulty-expert {
    color: var(--mc-expert) !important;
}

/* ===============================================
   Special Minecraft Elements
   =============================================== */

/* Experience bar style for progress */
.progress {
    background: #1A1A1A;
    border: 4px solid;
    border-color: #0A0A0A #3A3A3A #3A3A3A #0A0A0A;
    border-radius: 0 !important;
    height: 24px;
    overflow: visible;
}

.progress-bar {
    background: linear-gradient(180deg, #9AFF4A 0%, #7FFF00 50%, #5DCC00 100%);
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    box-shadow: 0 0 10px rgba(127, 255, 0, 0.5);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
}

/* Achievement unlocked animation */
@keyframes achievement-unlock {
    0% { transform: translateY(-100%) scale(0.5); opacity: 0; }
    20% { transform: translateY(0) scale(1.1); opacity: 1; }
    30% { transform: translateY(0) scale(1); }
    80% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100%); opacity: 0; }
}

.achievement-toast {
    animation: achievement-unlock 4s ease-in-out;
    background: linear-gradient(180deg, #3D3D3D 0%, #2D2D2D 100%);
    border: 4px solid;
    border-color: #5D5D5D #1D1D1D #1D1D1D #5D5D5D;
    color: var(--mc-gold);
}

/* Flag submission glow - Enhanced enchantment effect */
.flag-input {
    font-family: 'VT323', monospace;
    background-color: #1A1A1A;
    position: relative;
}

.flag-input:focus {
    animation: enchant-glow 1.5s ease-in-out infinite;
}

@keyframes enchant-glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--mc-emerald),
                    0 0 10px rgba(74, 237, 217, 0.3);
    }
    50% {
        box-shadow: 0 0 20px var(--mc-emerald),
                    0 0 40px rgba(74, 237, 217, 0.5),
                    0 0 60px rgba(74, 237, 217, 0.2);
    }
}

/* ===============================================
   Floating XP Orbs Animation
   =============================================== */
@keyframes float-up {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(0.5); opacity: 0; }
}

/* ===============================================
   Scrollbar - Minecraft Style
   =============================================== */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #1A1A1A;
    border: 2px solid #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6B6B6B 0%, #4B4B4B 100%);
    border: 2px solid;
    border-color: #8B8B8B #2B2B2B #2B2B2B #8B8B8B;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7B7B7B 0%, #5B5B5B 100%);
}

/* ===============================================
   Responsive Adjustments
   =============================================== */
@media (max-width: 640.98px) {
    html, body {
        font-size: 15px;
    }

    .top-row {
        justify-content: space-between;
    }

    .top-row a {
        margin-left: 0;
        font-size: 12px;
    }

    h1 { font-size: 1.2rem; }
    h2 { font-size: 1rem; }

    .nav-link {
        font-size: 15px;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 280px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* ===============================================
   Utility Classes
   =============================================== */
.text-muted {
    color: #8A8A8A !important;
}

.text-warning {
    color: var(--mc-gold) !important;
}

.text-success {
    color: var(--mc-emerald) !important;
}

.text-danger {
    color: var(--mc-redstone) !important;
}

.text-info {
    color: var(--mc-diamond) !important;
}

.text-white {
    color: var(--mc-text-light) !important;
}

.text-dark {
    color: var(--mc-text-dark) !important;
}

.border {
    border: 4px solid var(--mc-border) !important;
}

.rounded {
    border-radius: 0 !important;
}

/* Float badge fix */
.float-end {
    float: right;
}

/* Container padding */
.container {
    padding: 1rem;
}

/* Spacing */
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }

/* ===============================================
   Hint Panel Minecraft Style
   =============================================== */
.hint-panel {
    background: linear-gradient(180deg, var(--mc-wood-brown) 0%, var(--mc-wood-dark) 100%);
    border: 4px solid;
    border-color: #BFA07A #5A3D1D #5A3D1D #BFA07A;
    border-radius: 0;
    padding: 1rem;
    margin-top: 1rem;
}

.hint-warning {
    color: var(--mc-gold);
    font-size: 14px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
}

/* Hints in sidebar */
.col-lg-4 .card-body p,
.col-lg-4 .card-body li {
    font-size: 14px;
    line-height: 1.6;
}

.col-lg-4 .alert {
    font-size: 14px;
    padding: 12px;
}

.col-lg-4 .card-header {
    font-size: 14px;
}

/* ===============================================
   Leaderboard Styles
   =============================================== */
.leaderboard-position-up {
    color: var(--mc-emerald);
}

.leaderboard-position-down {
    color: var(--mc-redstone);
}

/* ===============================================
   OWASP Category Badge
   =============================================== */
.owasp-category-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 0;
    background: var(--mc-obsidian);
    border: 2px solid var(--mc-border-light);
    color: var(--mc-text-light);
}

/* ===============================================
   Error Handling
   =============================================== */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 4px solid var(--mc-emerald);
}

.invalid {
    outline: 4px solid var(--mc-redstone);
}

.validation-message {
    color: var(--mc-redstone);
    font-size: 14px;
}

#blazor-error-ui {
    background: linear-gradient(180deg, #5A2A2A 0%, #4A1A1A 100%);
    border-top: 4px solid var(--mc-redstone);
    bottom: 0;
    display: none;
    left: 0;
    padding: 12px 16px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--mc-text-light);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 12px;
    color: var(--mc-gold);
}

.blazor-error-boundary {
    background: linear-gradient(180deg, #5A2A2A 0%, #4A1A1A 100%);
    padding: 16px;
    color: var(--mc-redstone);
    border: 4px solid;
    border-color: #8A4A4A #2A0A0A #2A0A0A #8A4A4A;
}

.blazor-error-boundary::after {
    content: "CREEPER EXPLODED YOUR CODE!";
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    display: block;
    margin-top: 8px;
}

/* ===============================================
   Content Area
   =============================================== */
.content {
    padding-top: 1.1rem;
}

article.content {
    background: rgba(0,0,0,0.3);
    min-height: calc(100vh - 3.5rem);
    position: relative;
}

/* Nav scrollable area */
.nav-scrollable {
    background: transparent;
    padding: 8px 0;
}

/* ===============================================
   Fun Minecraft Cursor
   =============================================== */
* {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='0' y='0' width='4' height='4' fill='%23fff'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23fff'/%3E%3Crect x='8' y='8' width='4' height='4' fill='%23fff'/%3E%3Crect x='0' y='4' width='4' height='4' fill='%23bbb'/%3E%3Crect x='4' y='8' width='4' height='4' fill='%23bbb'/%3E%3Crect x='4' y='0' width='4' height='4' fill='%23888'/%3E%3Crect x='8' y='4' width='4' height='4' fill='%23888'/%3E%3Crect x='12' y='8' width='4' height='4' fill='%23888'/%3E%3Crect x='8' y='0' width='4' height='4' fill='%23555'/%3E%3Crect x='12' y='4' width='4' height='4' fill='%23555'/%3E%3C/svg%3E") 0 0, auto;
}

a, button, .btn, .nav-link, summary {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='6' y='0' width='4' height='4' fill='%23FCDB05'/%3E%3Crect x='2' y='4' width='4' height='4' fill='%23FCDB05'/%3E%3Crect x='6' y='4' width='4' height='4' fill='%23FFE44D'/%3E%3Crect x='10' y='4' width='4' height='4' fill='%23FCDB05'/%3E%3Crect x='6' y='8' width='4' height='4' fill='%23FCDB05'/%3E%3Crect x='2' y='8' width='4' height='4' fill='%23D4B800'/%3E%3Crect x='10' y='8' width='4' height='4' fill='%23D4B800'/%3E%3Crect x='6' y='12' width='4' height='4' fill='%23D4B800'/%3E%3C/svg%3E") 8 8, pointer;
}

/* ===============================================
   Block Breaking Animation (for clicks)
   =============================================== */
@keyframes block-break {
    0% { transform: scale(1); }
    25% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
    75% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.btn:active, .nav-link:active {
    animation: block-break 0.2s ease;
}

/* ===============================================
   Item Pickup Animation (disabled rotation)
   =============================================== */
@keyframes item-pickup {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.card, .alert {
    animation: item-pickup 0.2s ease-out;
}

/* ===============================================
   Nether Portal Effect (for special elements)
   =============================================== */
.nether-portal {
    position: relative;
    overflow: hidden;
}

.nether-portal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse, rgba(128, 0, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(200, 100, 255, 0.2) 0%, transparent 40%);
    animation: portal-swirl 4s linear infinite;
    pointer-events: none;
}

@keyframes portal-swirl {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================================
   Challenge Page Typography - Improved Readability
   =============================================== */

/* Form labels */
.form-label, label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--mc-text-light);
    margin-bottom: 6px;
    display: block;
}

/* Small text and muted text */
small, .small, .text-muted {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.5;
}

/* List items in card bodies */
.card-body li {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 6px;
}

/* Challenge description paragraphs */
.card-body p {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.7;
}

/* Table text */
.table {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
}

.table th {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 500;
    vertical-align: middle;
}

/* Button group buttons */
.btn-group .btn, .btn-sm {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
}

/* Input group text */
.input-group-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(180deg, #4D4D4D 0%, #3D3D3D 100%);
    border: 4px solid;
    border-color: #6D6D6D #2D2D2D #2D2D2D #6D6D6D;
    border-radius: 0 !important;
    color: var(--mc-text-light);
}

/* Code inside text (inline) */
p code, li code, td code {
    font-family: 'VT323', monospace;
    font-size: 16px;
    background: rgba(255, 102, 0, 0.2);
    padding: 2px 6px;
    color: var(--mc-lava-orange);
}

/* Hint section styling */
.alert strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 4px;
}

/* Select dropdowns */
.form-select, select.form-control {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 500;
}

/* Textarea */
textarea.form-control {
    font-family: 'VT323', monospace;
    font-size: 18px;
    line-height: 1.4;
}

/* Card titles (h5 inside cards) */
.card-body h5 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 700;
}

/* Learning resources links */
.list-unstyled a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 500;
}

/* Responsive font adjustments for mobile */
@media (max-width: 640.98px) {
    p, .card-body p {
        font-size: 15px;
    }

    .card-body li {
        font-size: 14px;
    }

    .alert {
        font-size: 14px;
    }

    .nav-link {
        font-size: 15px;
    }
}
