:root {
    --bg: #06080f;
    --bg2: #0d1117;
    --bg3: #161b22;
    --bg4: #21262d;
    --accent: #00ff88;
    --accent2: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.15);
    --cyan: #00d4ff;
    --purple: #a855f7;
    --red: #ff4757;
    --orange: #ff9f43;
    --text: #e6edf3;
    --text2: #8b949e;
    --text3: #484f58;
    --border: #30363d;
    --border2: #21262d;
    --success: #00ff88;
    --warning: #ff9f43;
    --danger: #ff4757;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: var(--bg4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent2);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-x {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.version {
    background: var(--accent);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.sidebar-upload {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg);
}

.dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.02);
}

.dropzone-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.dropzone p {
    color: var(--text2);
    font-size: 0.85rem;
}

.dropzone-hint {
    color: var(--text3);
    font-size: 0.7rem;
    display: block;
    margin-top: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg3);
    border-radius: 8px;
    margin-top: 10px;
}

.file-name {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text2);
    font-size: 0.7rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-icon:hover {
    background: var(--bg4);
    color: var(--danger);
}

.auto-flag-btn {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
}

.btn-flag {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ffa502, #ff6b6b);
    background-size: 200% 200%;
    animation: flagPulse 3s ease infinite;
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.2s;
}

.btn-flag:hover {
    transform: scale(1.03);
}

@keyframes flagPulse {

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

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

.nav-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text2);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg3);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
    border-left: 3px solid var(--accent);
}

.nav-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text3);
}

.sidebar-footer a {
    color: var(--cyan);
    text-decoration: none;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.3rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1100px;
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    margin-bottom: 25px;
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.panel-desc {
    color: var(--text2);
    font-size: 0.9rem;
}

.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.card:hover {
    border-color: var(--bg4);
}

.card h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.output-box {
    background: #000;
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 15px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    min-height: 50px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text2);
    position: relative;
}

.output-box.mono {
    font-size: 0.78rem;
}

.output-box .highlight {
    background: var(--accent);
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

input,
select,
textarea {
    padding: 8px 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="range"] {
    -webkit-appearance: none;
    background: var(--bg4);
    height: 5px;
    border-radius: 5px;
    border: none;
    padding: 0;
    width: 140px;
    vertical-align: middle;
    margin: 0 8px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

button {
    padding: 8px 18px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--accent2);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg4);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-red {
    background: #ff4757;
    color: #fff;
}

.btn-green {
    background: #2ed573;
    color: #000;
}

.btn-blue {
    background: #3742fa;
    color: #fff;
}

.btn-red:hover {
    background: #ff6b81;
}

.btn-green:hover {
    background: #7bed9f;
}

.btn-blue:hover {
    background: #5352ed;
}

.btn-zsteg {
    background: linear-gradient(135deg, #a855f7, #00d4ff);
    color: #fff;
    font-size: 0.9rem;
    padding: 10px 22px;
    letter-spacing: 0.5px;
}

.btn-zsteg:hover {
    background: linear-gradient(135deg, #c084fc, #22d3ee);
    transform: translateY(-1px);
}

.zsteg-status {
    font-size: 0.85rem;
    color: var(--cyan);
    font-weight: 600;
    padding: 6px 0;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text2);
    white-space: nowrap;
}

.controls-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.controls-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text2);
}

.controls-row label span {
    min-width: 30px;
    color: var(--accent);
    font-weight: 600;
}

.mt-10 {
    margin-top: 10px;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ref-table th,
.ref-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border2);
}

.ref-table th {
    color: var(--accent);
    font-weight: 600;
}

.ref-table code {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--cyan);
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
}

.os-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0 10px;
}

.os-hint {
    font-size: 0.78rem;
    color: var(--text2);
    font-style: italic;
}

/* OS badge (only for OS-specific commands/steps) */
.os-badge {
    display: inline-flex;
    align-items: center;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--text);
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.os-badge.os-linux {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.os-badge.os-windows {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.12);
    color: var(--purple);
}

.os-badge.os-any {
    border-color: rgba(156, 163, 175, 0.35);
    background: rgba(156, 163, 175, 0.10);
    color: var(--text2);
}

.os-badge.os-gui {
    border-color: rgba(255, 159, 67, 0.45);
    background: rgba(255, 159, 67, 0.12);
    color: var(--warning);
}

.table-scroll {
    overflow-x: auto;
}

.img-canvas {
    max-width: 100%;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: #111;
    display: block;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg4);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}

.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 12px 24px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 5px 30px rgba(0, 255, 136, 0.3);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.flag-found {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 165, 2, 0.15));
    border: 1px solid var(--orange);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--orange);
    font-weight: 600;
}

.flag-source {
    font-size: 0.7rem;
    color: var(--text3);
    font-weight: 400;
    display: block;
    margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        padding: 15px;
        padding-top: 50px;
    }
}
