/* AetherLab: Premium Creative Coding Sandbox CSS */

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(15, 23, 42, 0.65);
    --border-glow: rgba(139, 92, 246, 0.2);
    --border-glow-active: rgba(139, 92, 246, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --primary-color: #8b5cf6;
    --accent-color: #f43f5e;
    --glass-blur: blur(12px);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
}

.sandbox-container {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 85vh;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-premium);
}

/* Glassmorphism Panels */
.sandbox-sidebar {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sandbox-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sandbox-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sandbox-viewport {
    position: relative;
    height: 85vh;
    background-color: #030712;
    overflow: hidden;
}

/* Canvas styling */
.sandbox-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Glass HUD Overlay */
.sandbox-hud {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-family: monospace;
    color: #38bdf8;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Title bar */
.sandbox-title {
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #c084fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Control Panel Section Header */
.panel-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 12px;
    margin-top: 18px;
    display: flex;
    align-items: center;
}

.panel-section-title i {
    margin-right: 6px;
    font-size: 0.85rem;
}

/* Preset Cards */
.engine-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.engine-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.engine-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.engine-card.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.engine-card.locked {
    cursor: not-allowed;
    opacity: 0.7;
}

.engine-card i {
    font-size: 1.25rem;
    margin-bottom: 6px;
    display: block;
    color: var(--text-secondary);
}

.engine-card.active i {
    color: #c084fc;
}

.engine-card .lock-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    background: var(--accent-color);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
}

/* Range Inputs styling */
.sandbox-slider-container {
    margin-bottom: 12px;
}

.sandbox-slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.sandbox-slider-value {
    color: #c084fc;
    font-family: monospace;
    font-weight: 600;
}

.sandbox-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.15s ease;
}

.sandbox-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.8);
    transition: transform 0.1s ease;
}

.sandbox-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* Palette selector */
.palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.palette-item {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.palette-item.active {
    border-color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Code Editor */
.code-editor-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-editor-header {
    background: #0f172a;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-editor-textarea {
    width: 100%;
    height: 150px;
    background: #090d16;
    color: #38bdf8;
    border: none;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    padding: 8px;
    resize: none;
    outline: none;
}

.code-error-banner {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid var(--accent-color);
    color: #fda4af;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 6px;
    font-family: monospace;
}

/* Floating Actions on Viewport */
.viewport-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

.action-btn {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.action-btn.btn-locked {
    position: relative;
}

.action-btn.btn-locked::after {
    content: '🔒';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.65rem;
    background: var(--accent-color);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Premium Gating Overlay for Features */
.premium-blocker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 13, 22, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.premium-blocker-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 16px;
    max-width: 380px;
    box-shadow: var(--shadow-premium);
}

.premium-blocker-card i {
    font-size: 3rem;
    color: #a855f7;
    margin-bottom: 14px;
}

.premium-unlock-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.premium-unlock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
    color: white;
}

/* Modal styling */
.aether-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.aether-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.aether-modal-dialog {
    background: #0f172a;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aether-modal.open .aether-modal-dialog {
    transform: scale(1);
}

.aether-modal-body {
    padding: 30px;
    text-align: center;
    position: relative;
}

.aether-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.aether-modal-close:hover {
    color: var(--text-primary);
}

/* Toggle Switches */
.sandbox-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sandbox-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.sandbox-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 34px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider-round {
    background-color: #8b5cf6;
}

input:checked + .slider-round:before {
    transform: translateX(20px);
}

/* Dynamic Notification Toast */
.sandbox-toast {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-glow-active);
    color: #e2e8f0;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.sandbox-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Glowing Pulse effect for locks */
.glow-pulse {
    animation: glow-pulse-anim 2s infinite alternate;
}

@keyframes glow-pulse-anim {
    0% {
        box-shadow: 0 0 2px rgba(139, 92, 246, 0.2);
    }
    100% {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    }
}
