/* Dark mode theme variables */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-primary: #03dac6;
    --accent-secondary: #bb86fc;
    --error: #cf6679;
    --success: #4caf50;
    --warning: #ff9800;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bg-tertiary);
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent-secondary);
    text-shadow: 0 2px 4px var(--shadow);
}

/* Main layout */
main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

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

/* Settings panel */
.settings-panel {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow);
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--accent-secondary);
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option {
    background-color: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    background-color: #3d3d3d;
    color: var(--text-primary);
}

.option.selected {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 500;
}

/* Sliders */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--bg-tertiary);
    outline: none;
    margin-bottom: 10px;
}

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

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

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

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Action buttons */
.actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#solve-btn {
    background-color: var(--accent-secondary);
    color: var(--bg-primary);
}

#solve-btn:hover {
    background-color: #a56ef5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(187, 134, 252, 0.3);
}

.action-btn.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-btn.secondary:hover {
    background-color: #3d3d3d;
}

/* Visualization panel */
.visualization-panel {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow);
}

.cube-state {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .cube-state {
        grid-template-columns: 1fr;
    }
}

.cube-container {
    text-align: center;
}

.cube-container h3 {
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.cube-display {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cube-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* Solution panel */
.solution-panel {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
}

.solution-panel h3 {
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.moves-container {
    min-height: 100px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.move {
    background-color: var(--bg-secondary);
    color: var(--accent-secondary);
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 500;
    display: inline-block;
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

.stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--bg-secondary);
    padding-top: 15px;
}

.stat-label {
    color: var(--text-secondary);
    margin-right: 5px;
}

.stat-value {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 18, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--bg-tertiary);
    border-top: 5px solid var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Cube visualization styles */
.cube-face {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(3, 30px);
    gap: 2px;
    margin: 5px;
}

.cube-square {
    width: 30px;
    height: 30px;
    border-radius: 3px;
}

.cube-layout {
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-template-rows: repeat(3, auto);
    justify-content: center;
}

.face-up { grid-column: 2; grid-row: 1; }
.face-left { grid-column: 1; grid-row: 2; }
.face-front { grid-column: 2; grid-row: 2; }
.face-right { grid-column: 3; grid-row: 2; }
.face-back { grid-column: 4; grid-row: 2; }
.face-down { grid-column: 2; grid-row: 3; }

/* Cube colors */
.color-white { background-color: #f5f5f5; }
.color-yellow { background-color: #f1c40f; }
.color-blue { background-color: #3498db; }
.color-green { background-color: #2ecc71; }
.color-red { background-color: #e74c3c; }
.color-orange { background-color: #e67e22; }