:root {
    --bg-dark: #0a0a0f;
    --glass-bg: rgba(20, 20, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --neon-green: #00ff88;
    --neon-green-dim: rgba(0, 255, 136, 0.2);
    --neon-blue: #00e1ff;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --danger: #ff3366;
    
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--neon-green-dim) 0%, transparent 70%);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(0, 225, 255, 0.15) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Main Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
    margin: 40px 0;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.glitch-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    position: relative;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* Simple glitch effect */
.glitch-title::before, .glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-title::before {
    color: var(--neon-green);
    z-index: -1;
    left: 2px;
    animation: glitch 2s infinite linear alternate-reverse;
}

.glitch-title::after {
    color: var(--danger);
    z-index: -2;
    left: -2px;
    animation: glitch 3s infinite linear alternate-reverse;
}

@keyframes glitch {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(1px, -1px); }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--neon-green-dim);
    padding: 6px 16px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-green);
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(0,0,0,0.3);
    padding: 6px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--glass-border);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
    display: block;
}

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

/* Info Panel */
.info-panel {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--neon-blue);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(0,0,0,0.2);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--neon-green);
    background: rgba(0, 255, 136, 0.05);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.drop-content svg {
    color: var(--neon-green);
    margin-bottom: 10px;
}

.drop-content p {
    font-size: 1.2rem;
    font-weight: 600;
}

.subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

/* Preview Area */
.preview-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-wrapper {
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
    max-height: 400px;
    overflow: hidden;
}

#image-canvas {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 8px;
}

.controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--neon-green);
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 4px 15px var(--neon-green-dim);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--neon-green-dim);
    background: #00e67a;
}

.action-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 14px 24px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-secondary);
}

.processing-stats {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-blue);
    width: 100%;
    text-align: right;
}

/* Text Areas */
.text-areas {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

textarea {
    width: 100%;
    min-height: 150px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--neon-green);
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 0 2px var(--neon-green-dim);
}

.output-group textarea {
    border-color: var(--neon-blue);
    background: rgba(0, 225, 255, 0.05);
}

@media (max-width: 600px) {
    .glass-container {
        padding: 24px;
        width: 95%;
    }
    
    .glitch-title {
        font-size: 1.8rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .action-btn, .secondary-btn {
        width: 100%;
    }
    
    .processing-stats {
        text-align: center;
    }
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.3;
}

.splash-ghost {
    position: absolute;
    z-index: 2;
    width: 600px;
    height: 600px;
    opacity: 0.1;
    color: var(--neon-green);
    animation: ghost-glitch 4s infinite;
}

.splash-ghost svg {
    width: 100%;
    height: 100%;
}

@keyframes ghost-glitch {
    0%, 100% { transform: translate(0) scale(1); opacity: 0.1; filter: drop-shadow(0 0 10px var(--neon-green)); }
    10% { transform: translate(-5px, 5px) scale(1.05); opacity: 0.3; }
    11% { transform: translate(5px, -5px) scale(0.95); opacity: 0.1; }
    12% { transform: translate(0) scale(1); opacity: 0.1; }
    50% { transform: translate(0) scale(1); opacity: 0.1; }
    51% { transform: translate(10px, 0) scale(1.1); opacity: 0.4; filter: drop-shadow(0 0 30px var(--danger)); }
    52% { transform: translate(-10px, 0) scale(0.9); opacity: 0.1; }
}

.splash-content {
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.splash-title {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0;
    animation: glitch-in 0.5s forwards 0.5s;
}

.splash-subtitle {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--neon-blue);
    opacity: 0;
    animation: glitch-in 0.5s forwards 1.5s;
}

@keyframes glitch-in {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); filter: blur(10px); }
    20% { opacity: 1; transform: scale(1.1) translateY(-10px) skewX(20deg); filter: blur(0); }
    40% { transform: scale(0.95) translateY(5px) skewX(-10deg); color: var(--danger); }
    60% { transform: scale(1.02) translateY(-2px) skewX(5deg); color: var(--neon-green); }
    80% { transform: scale(0.98) translateY(1px) skewX(-2deg); }
    100% { opacity: 1; transform: scale(1) translateY(0) skewX(0); color: inherit; }
}

.enter-btn {
    margin-top: 40px;
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    padding: 16px 40px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fade-in-up 1s forwards 2.5s;
}

.enter-btn:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px var(--neon-green-dim);
}

@media (max-width: 600px) {
    .splash-title { font-size: 2.5rem; }
    .splash-subtitle { font-size: 1.2rem; }
}

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