:root {
    --primary-color: #ffb866;
    /* Golden/Amber Sepia - More "Active" */
    --secondary-color: #704214;
    /* Deep Classic Sepia */
    --bg-color: #050402;
    /* Almost Black */
    --alert-color: #ff3333;
    --scanline-color: rgba(0, 0, 0, 0.5);
    --font-main: 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    font-size: 16px;
    text-shadow: 0 0 5px var(--secondary-color);
}

/* --- CRT EFFECTS --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
}

.glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(112, 66, 20, 0.5);
    pointer-events: none;
    z-index: 999;
}

/* --- BOOT SEQUENCE --- */
#boot-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    padding: 2rem;
    z-index: 2000;
    overflow-y: hidden;
}

.boot-line {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- THE GATE --- */
#the-gate {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
}

.gate-container {
    border: 2px solid var(--primary-color);
    padding: 3rem;
    text-align: center;
    background: rgba(112, 66, 20, 0.1);
    box-shadow: 0 0 20px var(--secondary-color);
    position: relative;
}

.gate-container::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px dashed var(--secondary-color);
    pointer-events: none;
}

h1.glitch {
    font-size: 3rem;
    letter-spacing: 0.5rem;
    margin: 0 0 1rem 0;
    position: relative;
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

/* Input Styles */
.input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    background: #000;
    border: 1px solid var(--primary-color);
    padding: 0.5rem;
}

.prompt {
    font-weight: bold;
    margin-right: 0.5rem;
}

input#password-input {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-family: var(--font-main);
    font-size: 1.2rem;
    width: 200px;
    outline: none;
    text-transform: uppercase;
    caret-color: transparent;
    /* Custom cursor used */
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
}

.message {
    height: 1.5rem;
    margin-top: 1rem;
    font-weight: bold;
}

.error {
    color: var(--alert-color);
    text-shadow: 0 0 5px red;
}

.success {
    color: #00ff00;
    text-shadow: 0 0 5px lime;
}

/* --- SYSTEM CORE (Main UI) --- */
#system-core {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 2px solid var(--primary-color);
    background: rgba(0, 0, 0, 0.8);
}

.hud-center h2 {
    margin: 0;
    letter-spacing: 5px;
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0 10px;
}

button {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-main);
    padding: 5px 10px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* SECTOR GRID */
#sector-grid {
    flex: 1;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    overflow-y: auto;
}

/* SCROLLBAR */
#sector-grid::-webkit-scrollbar {
    width: 10px;
}

#sector-grid::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-left: 1px solid var(--secondary-color);
}

#sector-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

/* SECTOR CARDS (Folders) */
.sector-card {
    border: 1px solid var(--primary-color);
    padding: 1rem;
    position: relative;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    transition: 0.3s;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sector-card::after {
    content: "DIR";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7rem;
    opacity: 0.5;
}

.sector-card:hover {
    transform: scale(1.05);
    background: rgba(112, 66, 20, 0.2);
    box-shadow: 0 0 15px var(--primary-color);
    border-color: #fff;
}

.sector-name {
    font-weight: bold;
    font-size: 1.1rem;
    word-break: break-all;
}

.sector-info {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* DATA CHIPS (Files) */
.data-chip {
    border: 1px dashed var(--primary-color);
    padding: 0.8rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-chip:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

.data-icon {
    font-size: 1.5rem;
}

/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal-content {
    border: 2px solid var(--primary-color);
    padding: 2rem;
    width: 400px;
    text-align: center;
    background: #111;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    height: 20px;
    border: 1px solid var(--primary-color);
    margin: 20px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s;
}

/* ANIMATIONS */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes glitch-anim {
    0% {
        clip-path: inset(10% 0 80% 0);
        transform: translate(-2px, 2px);
    }

    20% {
        clip-path: inset(80% 0 10% 0);
        transform: translate(2px, -2px);
    }

    100% {
        clip-path: inset(40% 0 40% 0);
        transform: translate(-2px, 2px);
    }
}

.hidden {
    display: none !important;
}