/**
 * Reports Page CSS
 * Unified styling for reports and analytics page
 */

/* Import unified base styles */
@import url('unified-header-footer.css');

/* ==================== HERO SECTION ==================== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 3rem;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.hero-text {
    flex: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-stats .stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    min-width: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero-stats .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.hero-stats .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.stats-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.refresh-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-right: 4px solid #3b82f6;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
}

/* ==================== CHARTS SECTION ==================== */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.chart-period {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.85rem;
    background: white;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.chart-btn.active,
.chart-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.chart-container {
    height: 250px;
    position: relative;
}

/* ==================== REPORTS GENERATION ==================== */
.reports-generation {
    margin-bottom: 3rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #64748b;
    font-size: 1.1rem;
    margin: 0;
}

.report-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.report-type-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.report-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.report-type-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.report-type-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.generate-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.generate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* ==================== GENERATED REPORTS ==================== */
.generated-reports {
    margin-bottom: 3rem;
}

.reports-list {
    max-width: 800px;
    margin: 0 auto;
}

.no-reports {
    text-align: center;
    padding: 3rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.no-reports-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.no-reports h3 {
    color: #64748b;
    margin-bottom: 0.5rem;
}

.no-reports p {
    color: #9ca3af;
    margin: 0;
}

/* ==================== EXPORT OPTIONS ==================== */
.export-options {
    margin-bottom: 3rem;
}

.export-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.export-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.export-btn i {
    font-size: 1.1rem;
}

/* ==================== MODAL STYLES ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #374151;
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* ==================== PROGRESS BAR ==================== */
.report-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    color: #64748b;
    margin: 0;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #64748b;
    font-weight: 500;
    margin: 0;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-stats .stat-card {
        min-width: auto;
    }
    
    .report-types {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .export-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .stats-card,
    .chart-card {
        padding: 1.5rem;
    }
    
    .report-type-card {
        padding: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
}

/* ==================== DARK THEME SUPPORT ==================== */
[data-theme="dark"] {
    .stats-card,
    .chart-card,
    .report-type-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .stats-header h3,
    .chart-header h3,
    .report-type-card h3,
    .section-header h2 {
        color: #f1f5f9;
    }
    
    .stat-value {
        color: #f1f5f9;
    }
    
    .stat-label,
    .report-type-card p,
    .section-header p {
        color: #94a3b8;
    }
    
    .quick-stat {
        background: #0f172a;
    }
    
    .refresh-btn {
        background: #334155;
        color: #94a3b8;
    }
    
    .refresh-btn:hover {
        background: #475569;
        color: #cbd5e1;
    }
    
    .chart-period {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .chart-btn {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .no-reports {
        background: #0f172a;
        border-color: #334155;
    }
    
    .no-reports h3 {
        color: #94a3b8;
    }
    
    .no-reports p {
        color: #64748b;
    }
    
    .export-btn {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .export-btn:hover {
        border-color: #3b82f6;
        color: #3b82f6;
    }
    
    .modal-content {
        background: #1e293b;
    }
    
    .modal-header,
    .modal-footer {
        background: #0f172a;
        border-color: #334155;
    }
    
    .modal-header h3 {
        color: #f1f5f9;
    }
    
    .modal-close {
        color: #94a3b8;
    }
    
    .modal-close:hover {
        background: #334155;
        color: #cbd5e1;
    }
    
    .progress-bar {
        background: #334155;
    }
    
    .loading-overlay {
        background: rgba(15, 23, 42, 0.9);
    }
    
    .loading-spinner {
        border-color: #334155;
        border-top-color: #3b82f6;
    }
    
    .loading-overlay p {
        color: #94a3b8;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-type-card {
    animation: fadeInUp 0.6s ease forwards;
}

.report-type-card:nth-child(1) { animation-delay: 0.1s; }
.report-type-card:nth-child(2) { animation-delay: 0.2s; }
.report-type-card:nth-child(3) { animation-delay: 0.3s; }
.report-type-card:nth-child(4) { animation-delay: 0.4s; }

.stats-card,
.chart-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .hero-section,
    .modal,
    .loading-overlay {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .stats-grid,
    .charts-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-card,
    .chart-card,
    .report-type-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }
}