/* ════════════════════════════════════════════════════════════════
   PUZZLE PRACTICE PAGE STYLES
   Perfect Chess Academy
   ════════════════════════════════════════════════════════════════ */

/* ============================================
   LAYOUT
   ============================================ */
.practice-page {
    display: flex;
    min-height: calc(100vh - 60px);
    background: var(--bg-body);
    padding: 20px;
    gap: 20px;
}

.filters-sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.practice-page .board-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.practice-page .info-panel {
    width: 300px;
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */
.filters-header {
    padding: 16px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.filters-header h2 {
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.filters-header i {
    color: var(--accent-primary);
}

.filter-section {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.filter-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 12px;
}

/* ============================================
   DIFFICULTY OPTIONS
   ============================================ */
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.difficulty-option {
    cursor: pointer;
}

.difficulty-option input {
    display: none;
}

.difficulty-option .option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-body);
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

.difficulty-option input:checked+.option-card {
    border-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.05);
}

.option-card .icon {
    font-size: 20px;
}

.option-card .name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.option-card .range {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Roboto Mono', monospace;
}

/* Color coding */
.option-card.beginner .icon {
    filter: hue-rotate(80deg);
}

.option-card.intermediate .icon {
    filter: hue-rotate(30deg);
}

.option-card.advanced .icon {
    filter: hue-rotate(0deg);
}

.option-card.expert .icon {
    filter: hue-rotate(-30deg);
}

/* ============================================
   RATING SLIDER
   ============================================ */
.rating-slider {
    padding-top: 8px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.slider-labels span {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 14px;
}

.rating-slider input[type="range"] {
    width: 100%;
    margin: 4px 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.rating-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
}

.rating-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    margin-top: -6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rating-slider input[type="range"]::-moz-range-track {
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
}

.rating-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   SESSION STATS
   ============================================ */
.session-stats {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.session-stats h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.session-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.session-stats .stat-row:last-child {
    border-bottom: none;
}

.session-stats .stat-row span:first-child {
    color: var(--text-muted);
    font-size: 13px;
}

.session-stats .stat-row span:last-child {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

/* ============================================
   FILTER ACTIONS
   ============================================ */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-actions .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-actions .action-btn:hover {
    background: var(--bg-sidebar-alt);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   PUZZLE PROGRESS
   ============================================ */
.puzzle-progress {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
    padding: 12px 24px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.progress-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.progress-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
}

.progress-item .rating-badge {
    font-size: 16px;
    padding: 4px 12px;
}

.timer-display .value {
    color: var(--accent-primary);
}

/* ============================================
   PUZZLE RESULT OVERLAY
   ============================================ */
.puzzle-result {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.puzzle-result.success {
    background: rgba(16, 185, 129, 0.95);
}

.puzzle-result.failed {
    background: rgba(239, 68, 68, 0.95);
}

.result-content {
    text-align: center;
    color: white;
}

.result-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

.result-text {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-rating {
    font-size: 16px;
    opacity: 0.9;
}

/* ============================================
   NEXT BUTTON
   ============================================ */
.control-btn.next-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: white;
}

.control-btn.next-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ============================================
   RUN CARD
   ============================================ */
.run-card .run-display {
    text-align: center;
    padding: 24px 16px;
}

.run-display .run-count {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
}

.run-display .run-label {
    color: var(--text-muted);
    font-size: 14px;
}

.run-history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    justify-content: center;
}

.run-indicator {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.run-indicator.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.run-indicator.failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================
   TIPS CARD
   ============================================ */
.tips-card .tips-content {
    padding: 12px 16px;
}

.tips-content ul {
    margin: 0;
    padding-left: 20px;
}

.tips-content li {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .filters-sidebar {
        width: 240px;
    }

    .practice-page .info-panel {
        width: 260px;
    }
}

@media (max-width: 1024px) {
    .practice-page {
        flex-wrap: wrap;
    }

    .filters-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filters-sidebar>* {
        flex: 1;
        min-width: 250px;
    }

    .practice-page .board-section {
        width: 100%;
        order: -1;
    }

    .practice-page .info-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .practice-page .info-panel>* {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 600px) {
    .practice-page {
        padding: 12px;
        gap: 12px;
    }

    .puzzle-progress {
        gap: 16px;
        padding: 10px 16px;
    }

    .progress-item .value {
        font-size: 16px;
    }

    .difficulty-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .option-card .range {
        display: none;
    }

    .option-card .name {
        font-size: 13px;
    }
}