/* style.css */
:root {
    --primary-dark: #0D1117;
    --secondary-dark: #161B22;
    --accent-red: #B22222;
    --highlight-red: #DC143C;
    --text-light: #ffffff;
    --text-muted: #cccccc;
    --border: #30363D;
    --glow-red: 0 0 10px #DC143C;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app {
    display: flex;
    flex: 1;
}

header {
    background-color: var(--highlight-red);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.logo {
    text-align: left;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    text-shadow: var(--glow-red);
    letter-spacing: 2px;
}

header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: var(--primary-dark);
}

.token-counter {
    background: var(--secondary-dark);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: var(--glow-red);
}

.sidebar {
    width: 250px;
    background-color: var(--secondary-dark);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tab-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-light);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    font-size: 1rem;
}

.tab-btn:hover {
    background-color: var(--accent-red);
    box-shadow: inset var(--glow-red);
}

.tab-btn.active {
    background-color: var(--highlight-red);
    color: var(--primary-dark);
    box-shadow: var(--glow-red);
}

.main-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.workspace {
    display: grid;
    gap: 1rem;
    max-width: 1200px;
}

.input-section, .output-section {
    background: var(--secondary-dark);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: 0 0 5px rgba(220,20,60,0.2);
}

textarea {
    width: 100%;
    height: 300px;
    background: var(--primary-dark);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.output-wrapper {
    position: relative;
}

.output-code {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
}

.controls, .output-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

#level-select {
    padding: 0.5rem;
    background: var(--secondary-dark);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 1rem;
}

.btn.primary {
    background-color: var(--highlight-red);
    color: var(--primary-dark);
}

.btn.primary:hover {
    background-color: #ff4040;
    box-shadow: var(--glow-red);
}

.btn.secondary {
    background-color: var(--accent-red);
    color: var(--text-light);
}

.btn.secondary:hover {
    background-color: #a00000;
    box-shadow: var(--glow-red);
}

.form-container {
    max-width: 400px;
    margin: 0 auto;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

input[type="text"], input[type="password"] {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--secondary-dark);
    color: var(--text-light);
}

label {
    display: block;
    margin: 0.5rem 0;
}

.history {
    margin-top: 2rem;
}

.history h3 {
    color: var(--highlight-red);
    text-shadow: var(--glow-red);
}

#history-list {
    list-style: none;
    padding: 0;
}

#history-list li {
    background: var(--secondary-dark);
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

#history-list li:hover {
    background: var(--accent-red);
    box-shadow: var(--glow-red);
}

#license-message {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.stats-panel {
    background: var(--secondary-dark);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: var(--glow-red);
}

#stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: var(--primary-dark);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 2;
    }

    .main-content {
        order: 1;
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }

    .controls, .output-controls {
        flex-direction: column;
    }
}

/* Syntax Highlighting Basic */
.keyword { color: #569cd6; }
.string { color: #ce9178; }
.comment { color: #6a9955; }
.number { color: #b5cea8; }
.function { color: #dcdcaa; }