/* Advanced Chess Rules Display Styles */

.game-status-panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.status-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.toggle-details {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.toggle-details:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.status-main {
    padding: 20px;
}

.current-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.status-indicator {
    font-size: 1.5em;
}

.status-text {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.status-details {
    transition: all 0.3s ease;
}

.status-details.hidden {
    display: none;
}

.rule-section {
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.rule-section h4 {
    margin: 0;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95em;
    color: #495057;
    font-weight: 600;
}

.rule-items {
    padding: 15px;
}

.rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
    position: relative;
    transition: background-color 0.3s ease;
}

.rule-item:last-child {
    border-bottom: none;
}

.rule-item.highlighted {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding-left: 15px;
    margin-left: -15px;
    margin-right: -15px;
    padding-right: 19px;
}

.rule-name {
    font-weight: 500;
    color: #495057;
}

.rule-value {
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-left: 10px;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Fifty-move rule specific styling */
#fifty-move-rule {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

#fifty-move-rule .rule-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Castling Rights */
.castling-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 15px;
}

.castling-player h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 0.9em;
    font-weight: 600;
}

.castling-rights {
    display: flex;
    gap: 10px;
}

.castling-right {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.castling-right.available {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.castling-right.unavailable {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    text-decoration: line-through;
}

/* En Passant */
.en-passant-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
}

.stat-value {
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

/* Game Result Display */
.game-result {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

.game-result.hidden {
    display: none;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.result-icon {
    font-size: 2.5em;
}

.result-text {
    font-size: 1.3em;
    font-weight: 600;
}

.result-reason {
    font-size: 0.95em;
    opacity: 0.9;
    font-style: italic;
}

/* Rule Notifications */
.rule-notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    transition: opacity 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .status-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .toggle-details {
        width: 100%;
        text-align: center;
    }

    .current-status {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .castling-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .rule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    #fifty-move-rule .rule-value {
        width: 100%;
        justify-content: space-between;
    }

    .progress-bar {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Animation for rule highlighting */
@keyframes highlightRule {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: #fff3cd;
    }
    100% {
        background-color: transparent;
    }
}

.rule-item.highlighted {
    animation: highlightRule 0.6s ease-in-out;
}

/* Status color coding */
.current-status.check {
    border-left-color: #fd7e14;
    background: #fff4e6;
}

.current-status.checkmate {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.current-status.draw {
    border-left-color: #6c757d;
    background: #f8f9fa;
}

/* Print styles */
@media print {
    .game-status-panel {
        border: none;
        box-shadow: none;
    }

    .toggle-details,
    .rule-notification {
        display: none;
    }

    .status-details {
        display: block !important;
    }
}