/* ========================================
   ANALYTICS MODAL STYLES
   Matches contact page design with professional look
   ======================================== */

.analytics-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analytics-modal.show {
    display: flex !important;
    opacity: 1;
}

.analytics-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.analytics-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.analytics-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
}

.analytics-header-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.analytics-modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
}

.analytics-modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.analytics-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.analytics-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body */
.analytics-modal-body {
    padding: 32px;
}

/* Stats Grid */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.analytics-stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.analytics-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.analytics-stat-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.analytics-stat-card.primary .stat-value,
.analytics-stat-card.primary .stat-label,
.analytics-stat-card.primary .stat-trend {
    color: white;
}

.stat-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
}

.stat-trend.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-trend.neutral {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
}

/* Details Grid */
.analytics-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.analytics-detail-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.detail-icon {
    font-size: 24px;
}

.detail-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.detail-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.detail-label {
    font-size: 14px;
    color: #6b7280;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

/* Insights */
.analytics-insights {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #bae6fd;
}

.analytics-insights h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.insight-item.positive {
    border-left-color: #10b981;
}

.insight-item.neutral {
    border-left-color: #6b7280;
}

.insight-icon {
    font-size: 18px;
    font-weight: 700;
}

.insight-item.positive .insight-icon {
    color: #10b981;
}

.insight-item.neutral .insight-icon {
    color: #6b7280;
}

/* Footer Info */
.analytics-footer-info {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.analytics-footer-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #6b7280;
}

.analytics-note {
    font-size: 12px !important;
    opacity: 0.7;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .analytics-modal-content {
        background: #1f2937;
    }
    
    .analytics-stat-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .analytics-detail-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .stat-value,
    .stat-label,
    .detail-header h3,
    .detail-label,
    .detail-value,
    .analytics-insights h3,
    .analytics-footer-info p {
        color: #f9fafb;
    }
    
    .stat-label,
    .detail-label {
        color: #d1d5db;
    }
    
    .detail-header {
        border-bottom-color: #4b5563;
    }
    
    .analytics-insights {
        background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
        border-color: #3b5a80;
    }
    
    .insight-item {
        background: #2d3748;
    }
    
    .analytics-footer-info {
        border-top-color: #4b5563;
    }
}

[data-theme="dark"] .analytics-modal-content {
    background: #1f2937;
}

[data-theme="dark"] .analytics-stat-card {
    background: #374151;
}

[data-theme="dark"] .stat-value,
[data-theme="dark"] .detail-value {
    color: #f9fafb;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .analytics-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .analytics-modal-header {
        padding: 24px 20px;
    }
    
    .analytics-modal-header h2 {
        font-size: 22px;
    }
    
    .analytics-modal-body {
        padding: 20px;
    }
    
    .analytics-stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .analytics-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .analytics-close-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

/* Smooth Scrolling */
.analytics-modal-content {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.analytics-modal-content::-webkit-scrollbar {
    width: 8px;
}

.analytics-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.analytics-modal-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.analytics-modal-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
