/**
 * Simple Analytics - Monthly Report Styles
 * Clean, professional design for office use
 */

/* Base Container */
.sa-report-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #f8fafc;
    min-height: 100vh;
}

/* Header */
.sa-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.sa-header-left h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.sa-subtitle {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
}

.sa-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sa-header-right label {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.sa-header-right select {
    padding: 10px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sa-header-right select:hover {
    border-color: #3b82f6;
}

.sa-header-right select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Month Banner */
.sa-month-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    padding: 18px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.sa-month-icon {
    font-size: 28px;
}

.sa-month-title {
    flex: 1;
    font-size: 18px;
}

.sa-month-title strong {
    font-size: 22px;
}

/* Sections */
.sa-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.sa-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.sa-section-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* Stats Grid */
.sa-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.sa-stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sa-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.sa-stat-icon {
    font-size: 36px;
    line-height: 1;
}

.sa-stat-content {
    flex: 1;
}

.sa-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.sa-stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sa-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

/* Copy Buttons */
.sa-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sa-copy-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.sa-copy-btn:active {
    transform: translateY(0);
}

.sa-copy-btn.small {
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
}

.sa-copy-btn.tiny {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
}

.sa-copy-btn.tiny:hover {
    background: #3b82f6;
    color: #fff;
}

.sa-copy-btn.row-btn {
    padding: 5px 10px;
    font-size: 12px;
    background: #10b981;
}

.sa-copy-btn.row-btn:hover {
    background: #059669;
}

.sa-copy-btn.copied {
    background: #10b981 !important;
    color: #fff !important;
}

.sa-copy-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sa-copy-all-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Chart */
.sa-chart-wrapper {
    height: 320px;
    position: relative;
}

/* Tables */
.sa-table-wrapper {
    overflow-x: auto;
}

.sa-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sa-report-table th {
    padding: 14px 12px;
    text-align: left;
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.sa-report-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.sa-report-table tbody tr:hover {
    background: #f8fafc;
}

.sa-report-table.compact td,
.sa-report-table.compact th {
    padding: 10px;
    font-size: 13px;
}

.sa-cell-value {
    margin-right: 8px;
    font-weight: 500;
}

.sa-rank {
    font-weight: 700;
    color: #3b82f6;
    width: 50px;
}

.sa-page-cell {
    max-width: 280px;
}

.sa-page-cell .sa-cell-value {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.sa-user-cell {
    max-width: 200px;
}

.sa-user-cell .sa-cell-value {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-weight: 600;
    color: #1e293b;
}

.sa-email-cell {
    max-width: 250px;
}

.sa-email-cell .sa-cell-value {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: #64748b;
    font-size: 13px;
}

.sa-percentage {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 4px;
}

.sa-totals-row {
    background: #f0fdf4 !important;
}

.sa-totals-row td {
    border-top: 2px solid #10b981;
    border-bottom: 2px solid #10b981;
    color: #166534;
}

.sa-no-data {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 40px 20px !important;
}

/* Two Column Layout */
.sa-two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.sa-two-column .sa-section {
    margin-bottom: 0;
}

/* Toast Notification */
.sa-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.sa-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Print Styles */
@media print {
    .sa-report-wrap {
        background: #fff;
        padding: 0;
    }
    
    .sa-copy-btn,
    .sa-copy-all-btn,
    .sa-header-right,
    .sa-toast {
        display: none !important;
    }
    
    .sa-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .sa-report-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sa-header-right {
        width: 100%;
    }
    
    .sa-header-right select {
        flex: 1;
    }
    
    .sa-month-banner {
        flex-wrap: wrap;
    }
    
    .sa-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sa-stat-card {
        padding: 16px;
    }
    
    .sa-stat-value {
        font-size: 24px;
    }
    
    .sa-stat-icon {
        font-size: 28px;
    }
    
    .sa-two-column {
        grid-template-columns: 1fr;
    }
    
    .sa-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media screen and (max-width: 480px) {
    .sa-report-wrap {
        padding: 15px;
    }
    
    .sa-header-left h1 {
        font-size: 22px;
    }
    
    .sa-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sa-section {
        padding: 18px;
    }
    
    .sa-chart-wrapper {
        height: 250px;
    }
    
    .sa-report-table th,
    .sa-report-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .sa-page-cell .sa-cell-value {
        max-width: 120px;
    }
}
