:root {
    --bg-dark: #0f1115;
    --bg-card: rgba(23, 25, 30, 0.7);
    --primary: #4cc9f0;
    --secondary: #7209b7;
    --accent: #f72585;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.globe-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 40%;
    left: 40%;
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -50px); }
    66% { transform: translate(-20px, 20px); }
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
}

.highlight {
    color: var(--primary);
}

.mode-badge {
    background: rgba(76, 201, 240, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    border: 1px solid rgba(76, 201, 240, 0.2);
}

/* Encoder Card */
.encoder-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

/* Upload Section */
.upload-section {
    border: 2px dashed var(--border);
    border-radius: 16px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-section:hover, .upload-section.drag-over {
    border-color: var(--primary);
    background: rgba(76, 201, 240, 0.05);
}

.upload-content {
    text-align: center;
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.upload-section:hover .upload-icon {
    color: var(--primary);
}

.upload-content h3 {
    margin-bottom: 0.5rem;
}

.file-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Hidden Classes */
.hidden {
    display: none !important;
}

/* Preview Section */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

.scanline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.3) 3px
    );
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-estimate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
}

.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.5);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Audio Section */
.audio-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.5s ease;
}

.visualizer-container {
    height: 60px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

#visualizer {
    width: 100%;
    height: 100%;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--text-main);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-circle:hover {
    transform: scale(1.1);
}

.progress-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

#time-display {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100px;
    text-align: right;
}

.btn-download {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    border: 1px solid var(--primary);
    justify-content: center;
}

.btn-download:hover {
    background: var(--primary);
    color: white;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'Space Mono', monospace;
    opacity: 0.6;
}
