/**
 * PDF Export Button Styling
 * Mobile-first responsive design
 * 
 * @version 1.0.0
 * @created January 17, 2026
 */

/* PDF Export Button Container */
.pdf-export-container {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    text-align: center;
}

/* PDF Export Button */
.pdf-export-btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2);
    min-height: 48px; /* Touch-friendly */
    width: 100%;
    max-width: 300px;
}

.pdf-export-btn:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    box-shadow: 0 6px 8px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

.pdf-export-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

.pdf-export-btn:disabled {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Premium Button Styling */
.pdf-export-btn.premium {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.pdf-export-btn.premium:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 8px rgba(16, 185, 129, 0.3);
}

/* Free Tier Button with Upgrade Hint */
.pdf-export-btn.free {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.pdf-export-btn.free:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 6px 8px rgba(245, 158, 11, 0.3);
}

/* Upgrade Hint Text */
.upgrade-hint {
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.9;
}

/* Export Counter (Free Users) */
.pdf-export-counter {
    margin-top: 12px;
    font-size: 14px;
    color: #64748b;
}

.pdf-export-counter .remaining {
    font-weight: 600;
    color: #0ea5e9;
}

.pdf-export-counter .limit-warning {
    color: #f59e0b;
    font-weight: 600;
}

/* Loading State */
.pdf-export-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.pdf-export-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pdf-spinner 0.8s linear infinite;
}

@keyframes pdf-spinner {
    to { transform: rotate(360deg); }
}

/* Success Message */
.pdf-export-success {
    margin-top: 12px;
    padding: 12px;
    background: #d1fae5;
    border: 1px solid #10b981;
    border-radius: 6px;
    color: #064e3b;
    font-size: 14px;
    display: none;
}

.pdf-export-success.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error Message */
.pdf-export-error {
    margin-top: 12px;
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 6px;
    color: #7f1d1d;
    font-size: 14px;
    display: none;
}

.pdf-export-error.show {
    display: block;
    animation: slideIn 0.3s ease;
}

/* Upgrade Modal Trigger */
.pdf-upgrade-prompt {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 8px;
}

.pdf-upgrade-prompt h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #78350f;
}

.pdf-upgrade-prompt p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #92400e;
}

.pdf-upgrade-prompt .upgrade-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pdf-upgrade-prompt .upgrade-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

/* Pricing Badge */
.pdf-pricing-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: #10b981;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pdf-pricing-badge .old-price {
    text-decoration: line-through;
    opacity: 0.7;
    margin-right: 4px;
}

.pdf-pricing-badge .new-price {
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pdf-export-container {
        padding: 16px;
        margin: 16px 0;
    }
    
    .pdf-export-btn {
        padding: 14px 24px;
        font-size: 15px;
        max-width: 100%;
    }
    
    .upgrade-hint {
        font-size: 11px;
    }
    
    .pdf-export-counter {
        font-size: 13px;
    }
    
    .pdf-upgrade-prompt {
        padding: 12px;
    }
    
    .pdf-upgrade-prompt h4 {
        font-size: 14px;
    }
    
    .pdf-upgrade-prompt p {
        font-size: 13px;
    }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
    .pdf-export-btn {
        max-width: none; /* Remove max-width to prevent text wrapping - buttons auto-size to content */
    }
    
    .pdf-export-container {
        padding: 24px;
    }
}

/* Print Styles - Hide PDF buttons when printing */
@media print {
    .pdf-export-container,
    .pdf-export-btn,
    .pdf-upgrade-prompt {
        display: none !important;
    }
}

/* Accessibility */
.pdf-export-btn:focus {
    outline: 3px solid #0ea5e9;
    outline-offset: 2px;
}

.pdf-export-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .pdf-export-btn,
    .pdf-export-success,
    .pdf-export-error {
        animation: none;
        transition: none;
    }
    
    .pdf-export-btn:hover {
        transform: none;
    }
}
