/**
 * 4D Hypercube Simulator Styles
 * Constraint Theory Research Project
 *
 * Dark theme with glow effects for scientific visualization
 */

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

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #2a2a4e;
    --text-primary: #e0e0ff;
    --text-secondary: #a0a0c0;
    --accent-blue: #0088ff;
    --accent-red: #ff4400;
    --accent-green: #00ff88;
    --accent-purple: #8800ff;
    --glow-blue: 0 0 20px rgba(0, 136, 255, 0.5);
    --glow-red: 0 0 20px rgba(255, 68, 0, 0.5);
    --border-color: #3a3a5e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header */
.header {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.5em;
    font-weight: 300;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: var(--glow-blue);
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 20px;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#hypercube-canvas {
    display: block;
    width: 100%;
    height: 700px;
    cursor: grab;
}

#hypercube-canvas:active {
    cursor: grabbing;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(10, 10, 26, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.info-panel h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--accent-blue);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.info-value {
    font-size: 1.1em;
    color: var(--accent-green);
    font-weight: 600;
}

/* Controls Panel */
.controls-panel {
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 20px;
    max-height: 700px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.controls-panel::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h3 {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--accent-blue);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-select {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-select:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

.control-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Rotation Controls */
.rotation-control {
    margin-bottom: 15px;
}

.rotation-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.rotation-slider {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 5px;
}

.rotation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.5);
}

.rotation-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--glow-blue);
}

.rotation-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.rotation-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--glow-blue);
}

.rotation-value {
    display: inline-block;
    font-size: 0.85em;
    color: var(--accent-green);
    font-weight: 600;
    text-align: right;
}

/* Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--accent-blue);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* Reset Button */
.reset-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-blue);
}

.reset-button:active {
    transform: translateY(0);
}

/* Info Text */
.info-text {
    font-size: 0.85em;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 5px;
    border-left: 3px solid var(--accent-blue);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9em;
}

.footer a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    #hypercube-canvas {
        height: 400px;
    }

    .info-panel {
        position: relative;
        top: 0;
        right: 0;
        margin: 20px;
    }
}

/* Glow Effects */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 1.2em;
    color: var(--text-secondary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}
