/**
 * Kids Quiz Reward - History Button Modal CSS
 * Styles for the history button and modal overlay
 */

/* History Button */
.kqr-history-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

.kqr-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.kqr-history-btn:active {
    transform: translateY(0);
}

/* Modal Overlay */
.kqr-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: kqr-modal-fade-in 0.3s ease;
}

@keyframes kqr-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.kqr-history-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Container */
.kqr-history-modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: kqr-modal-slide-up 0.3s ease;
}

@keyframes kqr-modal-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.kqr-history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.kqr-history-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.kqr-history-modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    min-height: 44px;
    min-width: 44px;
}

.kqr-history-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Content */
.kqr-history-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.kqr-history-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #666;
}

.kqr-history-modal-loading .kqr-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: kqr-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes kqr-spin {
    to { transform: rotate(360deg); }
}

.kqr-history-modal-loading p {
    margin: 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kqr-history-modal {
        padding: 0.5rem;
    }

    .kqr-history-modal-container {
        max-height: 95vh;
        border-radius: 8px;
    }

    .kqr-history-modal-header {
        padding: 1rem 1.25rem;
        border-radius: 8px 8px 0 0;
    }

    .kqr-history-modal-header h2 {
        font-size: 1.25rem;
    }

    .kqr-history-modal-content {
        padding: 1rem;
    }

    .kqr-history-btn {
        width: 100%;
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .kqr-history-modal-header {
        padding: 0.875rem 1rem;
    }

    .kqr-history-modal-header h2 {
        font-size: 1.125rem;
    }

    .kqr-history-modal-content {
        padding: 0.75rem;
    }
}

/* Hide body scroll when modal is open */
body.kqr-modal-open {
    overflow: hidden;
}
