/**
 * PDF Button Styles - MOBILE FRIENDLY
 * File: assets/css/pdf-button.css
 * Version: 2.0 - With Mobile Support
 */

/* PDF Download Button - Base Styles */
.kt-btn-download-pdf {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    margin: 10px 5px;
    min-width: 200px;
    text-decoration: none;
    font-family: inherit;
}

.kt-btn-download-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: #fff;
}

.kt-btn-download-pdf:active {
    transform: translateY(0);
}

.kt-btn-download-pdf:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.kt-btn-download-pdf .pdf-icon {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
}

/* Loading Spinner */
.kt-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Message */
.kt-pdf-success-message {
    background: #10b981;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    animation: slideInUp 0.3s ease;
    text-align: center;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .kt-btn-download-pdf {
        width: 100%;
        max-width: 100%;
        padding: 16px 20px;
        font-size: 18px;
        margin: 15px 0;
        min-width: unset;
    }
    
    .kt-btn-download-pdf .pdf-icon {
        font-size: 24px;
    }
    
    .kt-pdf-success-message {
        width: 100%;
        max-width: 100%;
        text-align: center;
        font-size: 16px;
        padding: 14px 20px;
        margin: 10px 0;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .kt-btn-download-pdf {
        min-width: 220px;
        padding: 15px 24px;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .kt-btn-download-pdf {
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
    }
}

/* Android Chrome specific fixes */
@media (max-width: 768px) and (orientation: portrait) {
    .kt-btn-download-pdf {
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Button Container - Ensure proper layout */
.kt-quiz-result .kt-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
    width: 100%;
}

@media (min-width: 769px) {
    .kt-quiz-result .kt-result-actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Ensure all buttons in result area are consistent */
.kt-quiz-result .kt-btn {
    margin: 8px 5px;
}

@media (max-width: 768px) {
    .kt-quiz-result .kt-btn {
        width: 100%;
        margin: 8px 0;
    }
}

/* Focus states for accessibility */
.kt-btn-download-pdf:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.kt-btn-download-pdf:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .kt-btn-download-pdf {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .kt-btn-download-pdf,
    .kt-pdf-success-message,
    .kt-spinner-small {
        animation: none;
        transition: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .kt-btn-download-pdf {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .kt-btn-download-pdf:hover {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
}

/* Print styles - hide download button when printing */
@media print {
    .kt-btn-download-pdf,
    .kt-pdf-success-message {
        display: none !important;
    }
}