:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --accent-primary: #00ff88;
    --accent-secondary: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.3);
    --text-primary: #e0e0e0;
    --text-secondary: #888899;
    --text-muted: #555566;
    --border-color: #2a2a3a;
    --danger: #ff4466;
    --warning: #ffaa00;
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    text-shadow: 
        0 0 10px var(--accent-glow),
        0 0 20px var(--accent-glow),
        0 0 40px var(--accent-glow);
}

.logo-bracket {
    color: var(--text-muted);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.logo-text {
    color: var(--accent-primary);
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section-icon {
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.section-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.status-indicator {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 2px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.input-section,
.controls-section,
.preview-section,
.info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    animation: fadeIn 0.6s ease-out backwards;
}

.input-section { animation-delay: 0.1s; }
.controls-section { animation-delay: 0.2s; }
.preview-section { animation-delay: 0.3s; }
.info-section { animation-delay: 0.4s; }

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

.input-section::before,
.controls-section::before,
.preview-section::before,
.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.text-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.text-input::placeholder {
    color: var(--text-muted);
}

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

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.control-value {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--accent-glow);
}

.value-display {
    min-width: 50px;
    text-align: right;
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--accent-primary);
}

.color-controls {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker {
    width: 50px;
    height: 30px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.canvas-container {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#previewCanvas {
    display: block;
    max-width: 100%;
    background: var(--bg-primary);
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent-primary);
    border-style: solid;
    border-width: 0;
}

.corner.tl {
    top: 5px;
    left: 5px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.corner.tr {
    top: 5px;
    right: 5px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.corner.bl {
    bottom: 5px;
    left: 5px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.corner.br {
    bottom: 5px;
    right: 5px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.action-buttons,
.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-buttons {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

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

.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

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

.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-export {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1rem;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    padding: 1rem;
    background: var(--bg-primary);
    border-left: 2px solid var(--accent-primary);
}

.info-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
}

.info-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-text strong {
    color: var(--text-primary);
}

.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons,
    .export-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
