/* Root Variables - Technical/Dev Theme */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #161616;
    --bg-tertiary: #1f1f1f;
    --bg-card: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #9e9e9e;
    --text-muted: #6e6e6e;
    --accent-primary: #ff4444;
    --accent-secondary: #cc3636;
    --accent-dark: #992828;
    --accent-glow: rgba(255, 68, 68, 0.25);
    --border-color: #2d2d2d;
    --border-bright: #ff4444;
    --error-color: #ff4444;
    --success-color: #44ff88;
    --warning-color: #ffaa44;
    --terminal-green: #00ff41;
}

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

body {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

/* Grid pattern background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

/* Donation Banner */
.donation-banner {
    background-color: var(--bg-tertiary);
    border-bottom: 2px solid var(--accent-primary);
    color: var(--text-primary);
    text-align: center;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 100;
    font-family: 'IBM Plex Mono', monospace;
}

.donation-banner p {
    margin: 0;
}

.donation-banner a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid var(--accent-primary);
    padding-bottom: 1px;
    transition: all 0.2s;
    white-space: nowrap;
}

.donation-banner a:hover {
    color: var(--text-primary);
    background-color: var(--accent-primary);
    padding: 2px 6px;
    border-bottom: none;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: left;
    margin-bottom: 60px;
    border: 2px solid var(--border-color);
    padding: 32px;
    background-color: var(--bg-card);
    position: relative;
}

header::before {
    content: '>';
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--accent-primary);
    font-size: 20px;
    font-weight: 700;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

header h1 {
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 52px;
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

header h1::after {
    content: '_';
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

.tagline {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-left: 3px solid var(--accent-primary);
    padding-left: 12px;
    margin-top: 16px;
}

.tagline::before {
    content: '// ';
    color: var(--accent-primary);
}

/* Intro Section */
.intro {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 28px;
    margin-bottom: 40px;
    position: relative;
}

.intro::before {
    content: '[ INFO ]';
    position: absolute;
    top: -12px;
    left: 16px;
    background-color: var(--bg-primary);
    padding: 0 8px;
    color: var(--terminal-green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.intro h2 {
    font-size: 18px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.intro h3 {
    font-size: 14px;
    color: var(--accent-primary);
    margin: 24px 0 12px 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.intro p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.intro p:last-child {
    margin-bottom: 0;
}

/* Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin: 16px 0 24px 0;
}

.value-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary);
}

.value-label {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.value-desc {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

/* Responsibility List */
.responsibility-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px 0;
}

.responsibility-list li {
    padding: 8px 0 8px 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    position: relative;
}

.responsibility-list .bullet {
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 700;
}

/* Disclaimer Box */
.disclaimer-box {
    background-color: rgba(255, 68, 68, 0.05);
    border: 1px solid var(--accent-primary);
    border-left: 4px solid var(--accent-primary);
    padding: 16px;
    margin: 20px 0;
}

.disclaimer-box p {
    margin-bottom: 8px;
    font-size: 13px;
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

.disclaimer-box strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.limit-notice {
    color: var(--warning-color);
    font-weight: 600;
    font-size: 13px;
    padding: 12px 16px;
    background-color: rgba(255, 170, 68, 0.05);
    border: 1px solid var(--warning-color);
    border-left: 4px solid var(--warning-color);
    margin-top: 16px;
    font-family: 'IBM Plex Mono', monospace;
}

.limit-notice::before {
    content: '⚠ ';
}

/* Form Section */
.form-section {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 36px;
    margin-bottom: 40px;
    position: relative;
}

.form-section::before {
    content: '[ INPUT ]';
    position: absolute;
    top: -12px;
    left: 16px;
    background-color: var(--bg-primary);
    padding: 0 8px;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 28px;
}

.form-group:last-of-type {
    margin-bottom: 32px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

label::before {
    content: '$ ';
    color: var(--accent-primary);
}

select {
    width: 100%;
    padding: 12px 48px 12px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    font-size: 14px;
    font-family: 'IBM Plex Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23ff4444' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

select:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2);
    background-color: var(--bg-secondary);
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.checkbox-group label {
    display: block;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 14px 10px 40px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-tertiary);
    transition: all 0.2s;
    font-size: 13px;
    text-transform: none;
}

.checkbox-group label:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.checkbox-group label:has(input[type="checkbox"]:checked) {
    background-color: rgba(255, 68, 68, 0.08);
    border-color: var(--accent-primary);
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

/* Bracket notation using direct text */
.checkbox-group label {
    position: relative;
    padding-left: 32px;
}

.checkbox-group label::before {
    content: '[ ]';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 700;
}

.checkbox-group label:has(input[type="checkbox"]:checked)::before {
    content: '[X]';
    color: var(--accent-primary);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
}

.btn-primary {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary::before {
    content: '>';
}

.btn-primary::after {
    content: '<';
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.btn-primary:active:not(:disabled) {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary::before {
    content: '[';
    color: var(--text-secondary);
}

.btn-secondary::after {
    content: ']';
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.rate-limit-message {
    text-align: center;
    margin-top: 20px;
    color: var(--error-color);
    font-weight: 600;
    padding: 12px;
    background-color: rgba(255, 68, 68, 0.1);
    border: 2px solid var(--error-color);
    border-left: 4px solid var(--error-color);
    font-size: 13px;
}

.rate-limit-message::before {
    content: '[ERROR] ';
    font-weight: 700;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 0;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 1px;
}

.loading p::before {
    content: '[ ';
    color: var(--accent-primary);
}

.loading p::after {
    content: ' ]';
    color: var(--accent-primary);
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 13px;
}

.loading-subtext::before {
    content: '// ';
    color: var(--text-muted);
}

/* Results Section */
.results {
    background-color: var(--bg-card);
    border: 2px solid var(--accent-primary);
    padding: 36px;
    margin-bottom: 40px;
    position: relative;
}

.results::before {
    content: '[ OUTPUT ]';
    position: absolute;
    top: -12px;
    left: 16px;
    background-color: var(--bg-primary);
    padding: 0 8px;
    color: var(--terminal-green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.results h2 {
    font-family: 'VT323', monospace;
    font-size: 36px;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.results h2::before {
    content: '>> ';
    color: var(--accent-primary);
}

.results h2::after {
    content: ' <<';
    color: var(--accent-primary);
}

.playbook-content {
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.playbook-content::-webkit-scrollbar {
    width: 12px;
}

.playbook-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.playbook-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border: 2px solid var(--bg-secondary);
}

.playbook-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 28px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    position: relative;
    z-index: 1;
}

footer::before {
    content: '────────────────────────────────────────────────────────────────────────';
    display: block;
    color: var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
    text-align: center;
}

footer p {
    margin-bottom: 10px;
    line-height: 1.6;
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
    border-bottom: 1px solid transparent;
}

footer a:hover {
    color: var(--text-primary);
    border-bottom: 1px solid var(--accent-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 32px 20px;
    }

    header {
        padding: 24px 20px;
    }

    header h1 {
        font-size: 36px;
    }

    .tagline {
        font-size: 12px;
    }

    .form-section {
        padding: 24px 20px;
    }

    .results {
        padding: 24px 20px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .intro {
        padding: 20px;
    }
}

/* Terminal cursor effect */
@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
