/**
 * Reports Module Styles
 * Comprehensive styling for report visualizations
 */

/* Basic Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Report Modal Enhancements */
#reportsModal .modal-content {
    animation: slideInDown 0.3s ease-out;
}

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

/* Report Controls */
.report-controls {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.report-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.report-type-btn {
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #495057;
}

.report-type-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.report-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Date Range Selector */
.date-range-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #495057;
}

.preset-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.custom-date-range {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.custom-date-range label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.custom-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

/* Report Actions */
.report-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

/* Report Content */
#reportContent {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Report Header */
.report-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.report-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.report-period {
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

/* Summary Cards */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.summary-card:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.summary-icon {
    font-size: 48px;
    margin-right: 20px;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-content h3 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.summary-content p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.summary-content small {
    font-size: 12px;
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

.growth {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
    background: rgba(255,255,255,0.2);
}

.growth.positive {
    color: #28a745;
    background: rgba(40, 167, 69, 0.15);
}

.growth.negative {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
}

/* Report Charts */
.report-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.chart-container canvas {
    max-height: 350px;
}

/* Report Details Table */
.report-details {
    margin-top: 40px;
}

.report-details h3 {
    font-size: 22px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.report-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.report-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.report-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.report-table tbody tr:hover {
    background-color: #f8f9fa;
}

.report-table tbody tr:last-child {
    border-bottom: none;
}

.report-table td {
    padding: 15px;
    font-size: 14px;
    color: #495057;
}

.report-table td strong {
    color: #212529;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .report-type-tabs {
        flex-direction: column;
    }
    
    .report-type-btn {
        width: 100%;
    }
    
    .date-presets {
        flex-direction: column;
    }
    
    .preset-btn {
        width: 100%;
    }
    
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .custom-date-range label {
        width: 100%;
    }
    
    .report-summary {
        grid-template-columns: 1fr;
    }
    
    .report-charts {
        grid-template-columns: 1fr;
    }
    
    .report-header h2 {
        font-size: 24px;
    }
    
    .summary-card {
        flex-direction: column;
        text-align: center;
    }
    
    .summary-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .report-table {
        font-size: 12px;
    }
    
    .report-table th,
    .report-table td {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    .report-controls,
    .report-actions,
    .modal-header button {
        display: none !important;
    }
    
    #reportContent {
        box-shadow: none;
        padding: 0;
    }
    
    .report-summary {
        page-break-inside: avoid;
    }
    
    .chart-container {
        page-break-inside: avoid;
    }
    
    .report-table {
        page-break-inside: auto;
    }
    
    .report-table tr {
        page-break-inside: avoid;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Additional Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateX(5px);
}

.stat-card h4 {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* Activity Type Colors */
.activity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.activity-badge.visit {
    background: #e3f2fd;
    color: #1976d2;
}

.activity-badge.call {
    background: #f3e5f5;
    color: #7b1fa2;
}

.activity-badge.email {
    background: #fff3e0;
    color: #f57c00;
}

.activity-badge.meeting {
    background: #e8f5e9;
    color: #388e3c;
}
