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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e;
    color: #e6e6e6;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #00c2ff;
    text-shadow: 0 0 10px rgba(0, 194, 255, 0.5);
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(30, 30, 60, 0.7);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(0, 194, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 100, 255, 0.2);
}

.control-group {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.control-group label {
    margin-right: 10px;
    font-weight: bold;
    min-width: 100px;
    color: #afafff;
}

.control-group input[type="range"] {
    width: 200px;
    margin-right: 10px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #2e2e5a;
    border-radius: 3px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #00c2ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 194, 255, 0.8);
}

.vis-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
}

.vis-controls button {
    margin-right: 10px;
    background: linear-gradient(135deg, #9b59b6, #6a11cb);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
    transition: all 0.3s ease;
}

.vis-controls button:hover {
    background: linear-gradient(135deg, #8e44ad, #5b0fb3);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(106, 17, 203, 0.4);
}

#viz-mode-label {
    font-weight: bold;
    color: #afafff;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(175, 175, 255, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(-1px);
}

#generate-btn {
    background: linear-gradient(135deg, #00c2ff, #0880b3);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 194, 255, 0.3);
}

#generate-btn:hover {
    background: linear-gradient(135deg, #00b2ff, #0770a3);
    box-shadow: 0 7px 15px rgba(0, 194, 255, 0.4);
}

#generate-btn:disabled {
    background: #5c5c7a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

#stop-btn {
    background: linear-gradient(135deg, #ff5252, #b32f2f);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
}

#stop-btn:hover {
    background: linear-gradient(135deg, #ff3838, #a02929);
    box-shadow: 0 7px 15px rgba(255, 82, 82, 0.4);
}

#stop-btn:disabled {
    background: #5c5c7a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Canvas */
.canvas-container {
    width: 100%;
    margin: 0 auto;
    background-color: rgba(30, 30, 60, 0.5);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(0, 194, 255, 0.1);
    overflow: hidden;
    border: 1px solid rgba(100, 100, 255, 0.1);
    backdrop-filter: blur(5px);
}

#dance-canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Loading */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #1a1a2e;
    border-top: 5px solid #00c2ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(0, 194, 255, 0.5);
}

#loading-text {
    font-size: 20px;
    color: #afafff;
    text-shadow: 0 0 10px rgba(175, 175, 255, 0.5);
    letter-spacing: 1px;
}

.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        margin-bottom: 15px;
    }
    
    .control-group input[type="range"] {
        width: 100%;
    }
    
    .vis-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .vis-controls button, .vis-controls span {
        width: 100%;
        text-align: center;
    }
    
    .button-group {
        width: 100%;
        justify-content: space-between;
    }
    
    button {
        flex: 1;
    }
}
