:root {
    --bg-color: #0a0a0a;
    --panel-bg: #111111;
    --text-main: #e0e0e0;
    --primary: #00ff41;
    /* Hacker Green */
    --primary-dim: #008f11;
    --accent: #ff0055;
    /* Cyber Red */
    --border: #333;
    --font-mono: 'Share Tech Mono', monospace;
    --font-code: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    height: 100vh;
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.9)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a1a1a' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* CRT Scanline Effect */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(0, 255, 65, 0.1);
    opacity: 0.4;
    animation: scan 6s linear infinite;
    pointer-events: none;
    z-index: 999;
}

@keyframes scan {
    0% {
        top: -5%;
    }

    100% {
        top: 105%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--primary-dim);
    padding-bottom: 20px;
}

h1 {
    font-size: 2rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-dim);
}

.glitch {
    position: relative;
}

/* Simple Glitch Effect */
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--accent);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 100px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 100px, 0);
    }

    60% {
        clip: rect(40px, 9999px, 60px, 0);
    }

    80% {
        clip: rect(120px, 9999px, 140px, 0);
    }

    100% {
        clip: rect(60px, 9999px, 80px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(100px, 9999px, 120px, 0);
    }

    20% {
        clip: rect(20px, 9999px, 40px, 0);
    }

    40% {
        clip: rect(140px, 9999px, 160px, 0);
    }

    60% {
        clip: rect(60px, 9999px, 80px, 0);
    }

    80% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    100% {
        clip: rect(120px, 9999px, 140px, 0);
    }
}

.status-indicator {
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 5px 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator.connected {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-dim);
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
}

.panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
}

h2 {
    color: var(--text-main);
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

input,
textarea,
select {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 10px;
    font-family: var(--font-code);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
    appearance: none;
    /* Remove default arrow */
    border-radius: 0;
    /* Ensure sharp edges */
}

select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300ff41%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}

/* Style the options (Chrome/Firefox/Edge) */
option {
    background-color: #000;
    color: var(--primary);
    padding: 10px;
}

input[type="file"] {
    padding: 5px;
    cursor: pointer;
    color: var(--primary);
    /* Make filename text green */
}

input[type="file"]::file-selector-button {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 5px 10px;
    margin-right: 10px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.3s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary);
    color: #000;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

textarea {
    height: 150px;
    resize: vertical;
}

.cyber-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.cyber-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-dim);
}

.cyber-btn.small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.cyber-btn.active,
.cyber-btn.small.active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-dim), 0 0 25px rgba(0, 255, 65, 0.3);
    border-color: var(--primary);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px var(--primary-dim), 0 0 25px rgba(0, 255, 65, 0.3);
    }
    50% {
        box-shadow: 0 0 20px var(--primary-dim), 0 0 35px rgba(0, 255, 65, 0.5);
    }
}

.cyber-btn.action {
    width: 100%;
    margin-top: 10px;
    border-color: var(--accent);
    color: var(--accent);
}

.cyber-btn.action:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px #ff005588;
}

.hidden {
    display: none !important;
}

.terminal-output {
    background: #000;
    padding: 15px;
    border: 1px solid var(--border);
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: #aaa;
    min-height: 100px;
}

.factory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.file-card {
    border: 1px solid var(--border);
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
    background: rgba(0, 255, 65, 0.05);
}

.file-card.active {
    border-color: var(--primary);
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.file-name {
    font-size: 0.9rem;
}

/* Loot Box Styles */
.loot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.loot-card {
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loot-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
    background: rgba(0, 255, 65, 0.05);
    transform: translateY(-2px);
}

.loot-card:hover::before {
    opacity: 1;
}

.loot-card-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px currentColor);
}

.loot-card-info {
    flex: 1;
    min-width: 0;
}

.loot-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loot-card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.loot-card-size {
    color: var(--primary-dim);
}

.loot-card-date {
    color: #666;
}

.loot-card-type {
    font-size: 0.75rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loot-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.loot-card-actions .cyber-btn {
    padding: 8px 12px;
    min-width: auto;
}

.loot-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loot-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.loot-empty-text {
    font-size: 1.2rem;
    color: #888;
}

.loot-search {
    flex: 1;
    max-width: 300px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.loot-search:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 255, 65, 0.05);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.loot-sort {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.loot-sort:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 255, 65, 0.05);
}

/* Loot View Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--primary);
    border-radius: 4px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.loot-view-content {
    font-family: var(--font-code);
}

.loot-view-info {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 65, 0.05);
    border-left: 3px solid var(--primary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.loot-view-text,
.loot-view-binary {
    width: 100%;
}

.loot-text-preview,
.loot-hex-preview {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    overflow-x: auto;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-main);
}

.loot-text-preview code {
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}

.loot-hex-preview {
    font-family: var(--font-code);
    color: var(--primary-dim);
    letter-spacing: 1px;
}

.loot-view-note {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 0, 85, 0.1);
    border-left: 3px solid var(--accent);
    color: #ff6b9d;
    font-size: 0.9rem;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

/* Stat Counters */
.stat-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

.stat-label {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.stat-value {
    color: var(--primary);
    font-weight: bold;
    font-family: var(--font-code);
    font-size: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    font-family: var(--font-mono);
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.8rem;
    color: #444;
    border-top: 1px solid #222;
    padding-top: 20px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--accent);
}

.modal-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

/* Danger Button */
.cyber-btn.danger {
    border-color: #ff0000;
    color: #ff0000;
}

.cyber-btn.danger:hover {
    background: #ff0000;
    color: #fff;
    box-shadow: 0 0 20px #ff0000;
}

/* Light Theme */
body.light-theme {
    --bg-color: #f5f5f5;
    --panel-bg: #ffffff;
    --text-main: #1a1a1a;
    --primary: #00a832;
    --primary-dim: #007a25;
    --accent: #cc0033;
    --border: #ddd;
    background-color: var(--bg-color);
    color: var(--text-main);
}

body.light-theme .panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .cyber-btn {
    background: rgba(0, 168, 50, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

body.light-theme .cyber-btn:hover {
    background: var(--primary);
    color: #fff;
}

body.light-theme .terminal-output {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

body.light-theme .file-card {
    background: rgba(0, 168, 50, 0.05);
    border-color: var(--border);
}

body.light-theme .file-card:hover {
    background: rgba(0, 168, 50, 0.1);
    border-color: var(--primary);
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: var(--panel-bg);
    border-color: var(--border);
    color: var(--text-main);
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 168, 50, 0.2);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.settings-section {
    background: rgba(0, 255, 65, 0.03);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border);
}

body.light-theme .settings-section {
    background: rgba(0, 168, 50, 0.05);
}

/* Settings drag and drop */
.settings-section.dragging {
    opacity: 0.5;
}

.settings-section:hover {
    border-color: var(--primary);
}

/* Checkbox styling */
input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

label {
    cursor: pointer;
}

/* Payload Toggle Button */
#payloadModeToggle.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #000;
}

#payloadModeToggle.active:hover {
    background-color: var(--primary-dim);
    border-color: var(--primary-dim);
}

/* Tutorial Styles */
.tutorial-content {
    padding: 20px;
}

.tutorial-section {
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(0, 255, 65, 0.02);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
}

.tutorial-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-transform: uppercase;
}

.tutorial-section p {
    margin-bottom: 10px;
    line-height: 1.8;
}

.tutorial-section ul,
.tutorial-section ol {
    margin-left: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.tutorial-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.tutorial-section code {
    background: rgba(0, 255, 65, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-code);
    font-size: 0.9em;
    color: var(--primary);
}

.tutorial-section pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid var(--border);
}

.tutorial-section pre code {
    background: transparent;
    padding: 0;
    color: var(--text-main);
    font-size: 0.85rem;
}

#tutorial {
    margin: 20px auto;
    padding: 30px;
}

#tutorialLink {
    text-decoration: none;
    color: var(--text-main);
}

#tutorialLink:hover {
    background-color: var(--primary);
    color: #000;
}