/* American Express 60-Day Calculator - Custom Styles */

/* CSS Variables for consistent theming */
:root {
    --primary-blue: #1e40af;
    --primary-blue-dark: #1e3a8a;
    --secondary-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Base font family override */
.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* Animation classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Enhanced button styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
}

/* Enhanced form inputs */
input[type="date"]:focus,
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
    ring-width: 2px;
    ring-color: var(--secondary-blue);
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

/* Custom date input styling */
input[type="date"] {
    color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
}

/* Calculator results styling */
.calculator-results {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

/* Countdown timer special styling */
.countdown-urgent {
    animation: countdownPulse 2s infinite;
    background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
    border: 2px solid var(--danger-red) !important;
}

.countdown-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7) !important;
    border: 2px solid var(--warning-yellow) !important;
}

.countdown-safe {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
    border: 1px solid var(--success-green) !important;
}

/* Letter preview styling */
#letterPreview {
    background: linear-gradient(135deg, #ffffff, #f9fafb);
    border: 2px dashed var(--border-color);
    font-family: 'Courier New', 'Liberation Mono', monospace;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
}

#letterPreview pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Address box styling */
.address-box {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* FAQ styling enhancements */
.faq-toggle {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.faq-toggle:hover {
    background-color: #f3f4f6;
    transform: translateX(5px);
}

.faq-content {
    transition: all 0.3s ease;
    border-top: 1px solid var(--border-color);
}

/* Step guide enhancements */
.step-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.step-card:hover {
    border-left-color: var(--secondary-blue);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* Hero section enhancements */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue), var(--secondary-blue));
}

/* Alert boxes */
.alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    color: #166534;
}

/* Loading states */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-blue);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-gradient {
        padding: 2rem 0;
    }
    
    .hero-gradient h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .calculator-results {
        margin-top: 2rem;
    }
    
    #letterPreview {
        font-size: 0.75rem;
        max-height: 300px;
    }
    
    .step-card:hover {
        transform: none;
    }
    
    .faq-toggle:hover {
        transform: none;
    }
}

/* Print-specific styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .shadow-lg,
    .shadow-md {
        box-shadow: none;
    }
}

/* Accessibility enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0066cc;
        --secondary-blue: #0052a3;
        --text-dark: #000000;
        --border-color: #666666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1f2937;
        --text-dark: #f9fafb;
        --text-light: #d1d5db;
        --border-color: #374151;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dark);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Form validation styles */
.input-valid {
    border-color: var(--success-green) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.input-invalid {
    border-color: var(--danger-red) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Success states */
.success-message {
    background: var(--success-green);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    animation: slideIn 0.5s ease-out;
}

/* Progress indicators */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-blue), var(--accent-blue));
    transition: width 0.3s ease;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Typography enhancements */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Interactive elements */
.interactive:hover {
    cursor: pointer;
    opacity: 0.8;
}