/* Chess Notation & PGN Export Styles */

.move-history-panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
}

.move-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.move-history-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.move-history-controls {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.move-history-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    min-height: 200px;
}

.move-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.no-moves {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
}

.move-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.move-item:hover {
    background: #f5f5f5;
}

.move-item.selected {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.move-number {
    font-weight: bold;
    color: #666;
    margin-right: 8px;
    min-width: 30px;
}

.white-move, .black-move {
    padding: 2px 6px;
    margin: 0 4px;
    border-radius: 3px;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.white-move {
    background: #f8f8f8;
    color: #333;
}

.black-move {
    background: #333;
    color: white;
}

.move-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    font-size: 0.9em;
}

.game-info {
    display: flex;
    gap: 20px;
    color: #666;
}

.move-count, .game-result {
    font-weight: 500;
}

.move-count span, .game-result span {
    color: #333;
    font-weight: bold;
}

.notation-format {
    display: flex;
    gap: 15px;
}

.notation-format label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

/* PGN Modal Styles */
.pgn-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pgn-modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-modal:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 20px 25px;
    flex: 1;
    overflow-y: auto;
}

.modal-body textarea {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    min-height: 300px;
    line-height: 1.4;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 15px 25px 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Notification Styles */
.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;
}

/* Responsive Design */
@media (max-width: 768px) {
    .move-history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .move-history-controls {
        justify-content: space-around;
    }

    .btn-small {
        flex: 1;
        text-align: center;
    }

    .move-history-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .game-info {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header, .modal-body, .modal-footer {
        padding-left: 15px;
        padding-right: 15px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .move-history-panel {
        border: none;
        box-shadow: none;
        max-height: none;
    }

    .move-history-header,
    .move-history-footer,
    .move-history-controls {
        display: none;
    }

    .move-history-content {
        overflow: visible;
    }

    .move-item {
        break-inside: avoid;
        background: none !important;
        border: none !important;
    }
}