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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #0a0a0f;
    color: #e8e8f0;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #13131a;
    border-bottom: 1px solid #2a2a35;
}

.header-title {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.title-glitch {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    letter-spacing: -0.5px;
}

.title-afx {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e8e8f0;
}

.version {
    font-size: 0.75rem;
    color: #65657a;
    margin-left: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #2a2a35;
    border-radius: 0.5rem;
    background: #1a1a24;
    color: #e8e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    border-color: #00ff88;
}

.btn-primary {
    background: #00ff88;
    border-color: #00ff88;
    color: #0a0a0f;
}

.btn-primary:hover {
    background: #00cc6a;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.btn-accent {
    background: #ff0066;
    border-color: #ff0066;
    color: white;
}

.btn-accent:hover {
    background: #cc0052;
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.3);
}

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

.btn-secondary {
    background: #1a1a24;
    border-color: #2a2a35;
}

.btn.active {
    background: #ff0066;
    border-color: #ff0066;
    color: white;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #13131a;
    border-right: 1px solid #2a2a35;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9494a8;
    margin-bottom: 1rem;
}

.input-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-input {
    justify-content: center;
    width: 100%;
}

/* Presets Grid */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid #2a2a35;
    border-radius: 0.5rem;
    background: #1a1a24;
    color: #e8e8f0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: #00ff88;
    background: #1f1f2a;
    transform: translateY(-2px);
}

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

.preset-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* Effects */
.effects-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.effect-control {
    display: flex;
    flex-direction: column;
}

.effect-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.effect-name {
    color: #e8e8f0;
    text-transform: capitalize;
}

.effect-value {
    color: #00ff88;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.effect-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1a1a24;
    outline: none;
    cursor: pointer;
}

.effect-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.effect-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    padding: 2rem;
    position: relative;
}

#glitchCanvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0.5rem;
}

.empty-state {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0.5;
    pointer-events: none;
}

.empty-state svg {
    color: #65657a;
    margin-bottom: 1.5rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e8e8f0;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #9494a8;
}

.empty-state.hidden {
    display: none;
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #13131a;
    border: 1px solid #2a2a35;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #2a2a35;
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#statusText {
    color: #e8e8f0;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: #13131a;
    border-top: 1px solid #2a2a35;
    padding: 1rem 1.5rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-text {
    color: #9494a8;
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a1a24;
    border: 1px solid #2a2a35;
    color: #9494a8;
    transition: all 0.2s;
    text-decoration: none;
}

.social-link:hover {
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-height: 40vh;
    }

    .main-content {
        flex-direction: column;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .btn svg {
        width: 14px;
        height: 14px;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #13131a;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #2a2a35;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #3a3a45;
}
