/* Game Controls and UI Elements */

/* Button Group Layouts */
.game-controls {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-controls .btn {
    width: 100%;
    text-align: center;
}

/* Move History Styling */
.move-history {
    padding: 0.5rem;
}

.move-entry {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    display: grid;
    grid-template-columns: 40px 1fr 1fr;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.move-entry:hover {
    background-color: var(--light-bg);
}

.move-entry.active {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 3px solid var(--secondary-color);
}

.move-number {
    font-weight: bold;
    color: var(--text-secondary);
}

.move-notation {
    color: var(--text-primary);
}

.move-notation.white {
    text-align: left;
}

.move-notation.black {
    text-align: right;
}

/* Game Status Indicators */
.status-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-indicator.active {
    background-color: var(--success-color);
    color: white;
}

.status-indicator.check {
    background-color: var(--danger-color);
    color: white;
    animation: pulse 1s ease infinite;
}

.status-indicator.checkmate,
.status-indicator.stalemate,
.status-indicator.draw {
    background-color: var(--dark-bg);
    color: white;
}

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

/* Timer Display (for future implementation) */
.timer-display {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.timer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.timer-value {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.timer.active .timer-value {
    color: var(--secondary-color);
}

.timer.warning .timer-value {
    color: var(--danger-color);
    animation: pulse 1s ease infinite;
}

/* Settings Panel (collapsible) */
.settings-panel {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0;
}

.settings-header h3 {
    font-size: 1rem;
    color: var(--text-secondary);
}

.settings-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.settings-content.expanded {
    max-height: 400px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-bg);
}

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

.setting-label {
    font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--secondary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Notification Toast */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(200%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast-notification.show {
    transform: translateY(0);
}

.toast-notification.success {
    background-color: var(--success-color);
}

.toast-notification.error {
    background-color: var(--danger-color);
}

.toast-notification.warning {
    background-color: #f39c12;
}

/* Loading Spinner (for AI moves) */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Controls */
@media (max-width: 768px) {
    .game-controls {
        grid-template-columns: 1fr 1fr;
    }

    .move-entry {
        grid-template-columns: 30px 1fr 1fr;
    }

    .toast-notification {
        left: 1rem;
        right: 1rem;
    }
}
