/* 5D Simplex Projection Simulator Styles */
/* Constraint Theory Research Project */

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --bg-tertiary: #2a2f4a;
    --text-primary: #e0e6ed;
    --text-secondary: #a0a6b0;
    --accent-primary: #4ecdc4;
    --accent-secondary: #45b7d1;
    --accent-tertiary: #ff6b6b;
    --border-color: #3a4f6a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(78, 205, 196, 0.3);
}

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

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);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

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

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

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr 350px;
    }

    .info-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1000px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Canvas Container */
.canvas-container {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

canvas {
    width: 100%;
    height: 600px;
    background: var(--bg-primary);
    border-radius: 10px;
    display: block;
}

.canvas-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

#dimensionLabel {
    font-weight: 700;
    color: var(--accent-primary);
}

#vertexCount {
    color: var(--text-secondary);
}

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

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

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

.controls-panel::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    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;
    padding-bottom: 0;
}

.control-section h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Dimension Buttons */
.dimension-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.dim-btn {
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.dim-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.dim-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 700;
}

/* Rotation Controls */
.rotation-controls {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.rotation-controls::-webkit-scrollbar {
    width: 6px;
}

.rotation-plane {
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

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

.rotation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: var(--glow);
}

.rotation-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    box-shadow: var(--glow);
}

.angle-value {
    font-size: 0.8em;
    color: var(--accent-secondary);
    font-family: 'Courier New', monospace;
}

/* Radio and Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    transition: color 0.2s ease;
}

.radio-group label:hover,
.checkbox-group label:hover {
    color: var(--accent-primary);
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Slider Groups */
.slider-group {
    margin-top: 15px;
}

.slider-group label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-secondary);
    cursor: pointer;
    box-shadow: var(--glow);
}

/* Reset Button */
.reset-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--accent-tertiary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.reset-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.4);
}

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

/* Info Panel */
.info-panel {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-height: 700px;
    overflow-y: auto;
}

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

.info-panel::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

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

.info-panel h3 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: var(--accent-primary);
    font-weight: 600;
}

.info-panel h4 {
    font-size: 1em;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--accent-secondary);
    font-weight: 600;
}

.info-panel p {
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Property Grid */
.property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.property-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: var(--accent-primary);
    font-weight: 700;
}

/* Formula Section */
.formula-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.formula {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-secondary);
    text-align: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-top: 10px;
}

/* Explanation Section */
.explanation-section {
    margin-top: 20px;
}

.explanation-section h4 {
    margin-top: 15px;
}

.explanation-section p {
    font-size: 0.85em;
    margin-bottom: 12px;
}

.explanation-section strong {
    color: var(--accent-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

footer p {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

footer p:last-child {
    margin-bottom: 0;
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .dimension-buttons {
        grid-template-columns: 1fr;
    }

    .property-grid {
        grid-template-columns: 1fr;
    }

    canvas {
        height: 400px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .controls-panel,
    footer {
        display: none;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
button:focus,
input:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}
