:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --panel-bg: #2a2a3a;
    --text-color: #e6e6e6;
    --accent-color: #4cc9f0;
    --success-color: #4ad295;
    --warning-color: #f8961e;
    --error-color: #f94144;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.app-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

.preview-panel {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    position: relative;
}

.canvas-container {
    width: 100%;
    aspect-ratio: 1/1;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.performance-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.control-panel {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

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

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.param-name {
    font-weight: 500;
}

.param-value {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    outline: none;
    flex-grow: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--accent-color);
}

.styled-select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: none;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.styled-select:focus {
    outline: 2px solid var(--accent-color);
}

.stepper-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stepper-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

.stepper-btn:active {
    transform: scale(0.95);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.action-btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

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

/* Responsive Design */
@media (min-width: 768px) {
    .main-content {
        flex-direction: row;
    }

    .preview-panel {
        flex: 2;
    }

    .control-panel {
        flex: 1;
        max-width: 350px;
    }
}

/* Animation for loading */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading {
    animation: pulse 1.5s infinite;
}