:root {
    --sky-top: #0b1026;
    --sky-bottom: #1b2547;

    --panel: #2a2a3a;
    --panel-light: #37374a;
    --panel-border: #121218;
    --bevel-light: rgba(255, 255, 255, 0.16);
    --bevel-dark: rgba(0, 0, 0, 0.45);
    --hard-shadow: rgba(0, 0, 0, 0.4);

    --text: #f3efe3;
    --text-muted: #b9b4c9;
    --text-faint: #837f99;

    --diamond: #57e3e0;
    --gold: #f6c445;
    --redstone: #e0483e;
    --emerald: #46c26b;

    --font-pixel: 'Press Start 2P', 'Courier New', monospace;
    --font-mono: 'VT323', 'Courier New', monospace;
}

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

body {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--text);
    background:
        radial-gradient(1.5px 1.5px at 10% 15%, #fff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 25% 40%, #fff 0, transparent 60%),
        radial-gradient(1px 1px at 40% 10%, #fff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 60% 30%, #fff 0, transparent 60%),
        radial-gradient(1px 1px at 75% 20%, #fff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 85% 45%, #fff 0, transparent 60%),
        radial-gradient(1px 1px at 15% 60%, #fff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 50% 55%, #fff 0, transparent 60%),
        radial-gradient(1px 1px at 90% 65%, #fff 0, transparent 60%),
        linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px 20px 20px 150px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

h1, h2, h3 {
    font-family: var(--font-pixel);
    line-height: 1.5;
}

.main-container {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    align-items: flex-start;
}

.container {
    background: var(--panel);
    border: 3px solid var(--panel-border);
    box-shadow:
        inset 3px 3px 0 var(--bevel-light),
        inset -3px -3px 0 var(--bevel-dark),
        7px 7px 0 var(--hard-shadow);
    border-radius: 6px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

/* ---------- Left hotbar nav ---------- */

.left-sidebar-container {
    position: fixed;
    left: 14px;
    top: 20px;
    height: auto;
    width: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

.left-sidebar-items {
    border: 3px solid var(--panel-border);
    border-radius: 6px;
    box-shadow:
        inset 2px 2px 0 var(--bevel-light),
        inset -2px -2px 0 var(--bevel-dark),
        4px 4px 0 var(--hard-shadow);
    padding: 10px 6px;
    margin-top: 0;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100px;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.left-sidebar-items:hover {
    transform: translate(-1px, -3px);
    box-shadow:
        inset 2px 2px 0 var(--bevel-light),
        inset -2px -2px 0 var(--bevel-dark),
        5px 7px 0 var(--hard-shadow);
}

.left-sidebar-items:active {
    transform: translate(1px, 1px);
    box-shadow: inset -2px -2px 0 var(--bevel-dark), 2px 2px 0 var(--hard-shadow);
}

.ls-item-home {
    background: var(--panel-light);
    color: var(--text);
}

.ls-item-home:hover {
    background: var(--panel-light);
    border-color: var(--diamond);
}

.ls-item-kofi {
    background: linear-gradient(180deg, #ffd873, var(--gold));
    color: #3a2b06;
    font-weight: 700;
}

.ls-item-kofi:hover {
    border-color: #3a2b06;
}

/* ---------- Right sidebar (results) ---------- */

.sidebar {
    background: var(--panel);
    border: 3px solid var(--panel-border);
    box-shadow:
        inset 3px 3px 0 var(--bevel-light),
        inset -3px -3px 0 var(--bevel-dark),
        7px 7px 0 var(--hard-shadow);
    border-radius: 6px;
    padding: 30px;
    width: 400px;
    max-height: 100vh;
    overflow-y: auto;
    display: block;
    flex-shrink: 0;
}

.sidebar.show {
    display: block;
}

.sidebar h3 {
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1rem;
    background: none;
    -webkit-text-fill-color: var(--gold);
    text-align: center;
    border-bottom: 3px solid var(--panel-border);
    padding-bottom: 14px;
}

.recipe-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--panel-light);
    border: 2px solid var(--panel-border);
    border-radius: 6px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-pixel);
    font-size: 1.3em;
    display: block;
    text-shadow: 2px 2px 0 var(--hard-shadow);
}

.stat-number.success { color: var(--emerald); }
.stat-number.warning { color: var(--gold); }
.stat-number.error { color: var(--redstone); }

.stat-label {
    font-size: 0.85em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.recipe-list {
    max-height: 50vh;
    overflow-y: auto;
    border: 2px solid var(--panel-border);
    border-radius: 6px;
    background: var(--panel-light);
}

.recipe-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background-color 0.2s ease;
    position: relative;
}

.recipe-item:hover {
    background-color: rgba(87, 227, 224, 0.08);
}

.recipe-item:last-child {
    border-bottom: none;
}

.recipe-icon {
    margin-right: 10px;
    font-size: 1.2em;
    width: 20px;
    text-align: center;
}

.recipe-icon.success { color: var(--emerald); }
.recipe-icon.warning { color: var(--gold); }
.recipe-icon.error { color: var(--redstone); }

.recipe-name {
    flex: 1;
    text-align: left;
    font-size: 1rem;
    color: var(--text);
}

.recipe-tooltip {
    position: absolute;
    background: var(--panel-border);
    color: var(--text);
    padding: 8px 12px;
    border: 2px solid var(--panel-border);
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    margin-bottom: 5px;
}

.recipe-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: var(--panel-border);
}

.recipe-item:hover .recipe-tooltip {
    opacity: 1;
}

@media (max-width: 1024px) {
    body {
        flex-direction: column;
        align-items: center;
        padding-left: 20px;
    }

    .left-sidebar-container {
        position: static;
        flex-direction: row;
        width: auto;
        margin-bottom: 16px;
    }

    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .sidebar {
        width: 100%;
        max-width: 600px;
        max-height: 400px;
    }
}

h1 {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 1.4em;
    background: none;
    -webkit-text-fill-color: var(--text);
    text-shadow: 3px 3px 0 var(--hard-shadow);
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1.2em;
}

.upload-area {
    border: 3px dashed var(--diamond);
    border-radius: 10px;
    padding: 40px 20px;
    margin: 30px 0;
    background: rgba(87, 227, 224, 0.06);
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--gold);
    background: rgba(246, 196, 69, 0.08);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--gold);
    background: rgba(246, 196, 69, 0.14);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    color: var(--diamond);
    margin-bottom: 15px;
    display: block;
}

.upload-text {
    color: var(--text);
    font-size: 1.3em;
    margin-bottom: 10px;
}

.upload-subtext {
    color: var(--text-muted);
    font-size: 1em;
}

input[type="file"] {
    display: none;
}

.btn {
    background: linear-gradient(180deg, #6fd6c7, var(--diamond));
    color: #063a37;
    border: 3px solid var(--panel-border);
    padding: 13px 26px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 1.15em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin: 10px;
    box-shadow:
        inset 2px 2px 0 rgba(255, 255, 255, 0.5),
        inset -2px -2px 0 rgba(0, 0, 0, 0.25),
        5px 5px 0 var(--hard-shadow);
}

.btn:hover {
    transform: translate(-1px, -3px);
    box-shadow:
        inset 2px 2px 0 rgba(255, 255, 255, 0.5),
        inset -2px -2px 0 rgba(0, 0, 0, 0.25),
        6px 8px 0 var(--hard-shadow);
}

.btn:active {
    transform: translate(1px, 1px);
    box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.25), 2px 2px 0 var(--hard-shadow);
}

.btn:disabled {
    background: var(--panel-light);
    color: var(--text-faint);
    cursor: not-allowed;
    transform: none;
    box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
}

.progress-bar {
    width: 100%;
    height: 14px;
    background: var(--panel-light);
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald), var(--diamond));
    width: 0%;
    transition: width 0.3s ease;
}

.status {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 6px;
    display: none;
    text-align: left;
    font-size: 1.1em;
    border: 2px solid var(--panel-border);
}

.status.success {
    background: rgba(70, 194, 107, 0.12);
    color: var(--emerald);
    border-left: 5px solid var(--emerald);
}

.status.error {
    background: rgba(224, 72, 62, 0.12);
    color: var(--redstone);
    border-left: 5px solid var(--redstone);
}

.status.info {
    background: rgba(87, 227, 224, 0.1);
    color: var(--diamond);
    border-left: 5px solid var(--diamond);
}

.file-info {
    background: var(--panel-light);
    border: 2px solid var(--panel-border);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    display: none;
}

.file-name {
    font-weight: bold;
    color: var(--text);
    margin-bottom: 5px;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.95em;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.processing {
    animation: pulse 2s infinite;
}
