/* NSMA Analytics Dashboard Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item a:hover,
.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item a i {
    margin-right: 0.75rem;
    width: 1.2rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.user-info i {
    margin-right: 0.5rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.logout-btn i {
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Header */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-selector label {
    font-weight: 500;
    color: #4a5568;
}

.site-selector select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1a202c;
    font-size: 0.9rem;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #4e73df;
    color: white;
}

.btn-primary:hover {
    background-color: #2e59d9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-header h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    color: #a0aec0;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-change.positive {
    color: #38a169;
}

.stat-change.negative {
    color: #e53e3e;
}

.stat-change i {
    margin-right: 0.25rem;
}

/* Charts Section */
.charts-section {
    padding: 0 2rem 2rem;
}

.chart-container {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    height: 400px; /* Fixed height */
    position: relative;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
}

.chart-controls select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1a202c;
    font-size: 0.9rem;
}

/* Tables Section */
.tables-section {
    padding: 0 2rem 2rem;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.table-container {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}

.view-all {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.view-all:hover {
    color: #5a67d8;
}

.table-content {
    max-height: 300px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    color: #1a202c;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: #f8fafc;
}

.page-url {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-flag {
    margin-right: 0.5rem;
}

.no-data {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}

/* Live Activity */
.live-activity {
    margin: 0 2rem 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.activity-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
}

.live-indicator {
    color: #38a169;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.last-update {
    font-size: 0.875rem;
    color: #718096;
}

.activity-content {
    padding: 1rem 1.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.75rem;
}

.activity-details {
    flex: 1;
}

.activity-url {
    font-weight: 500;
    color: #1a202c;
    font-size: 0.9rem;
}

.activity-meta {
    font-size: 0.8rem;
    color: #718096;
}

.activity-time {
    font-size: 0.8rem;
    color: #a0aec0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #718096;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-btn:hover {
    background: #5a67d8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-end;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .table-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-controls {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .date-range {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .stats-grid,
    .charts-section,
    .tables-section {
        padding: 1rem;
    }
    
    .stat-card,
    .chart-container,
    .table-container {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .sidebar-header {
        padding: 1.5rem 1rem;
    }
    
    .nav-item a {
        padding: 0.5rem 1rem;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }
.visible { display: block; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.content-grid .full-width {
    grid-column: 1 / -1;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.card-header i {
    margin-right: 0.5rem;
    color: #4a5568;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    border-color: #e2e8f0;
    color: #4a5568;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* Period Selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.period-selector label {
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
}

.period-selector select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1a202c;
    font-size: 0.875rem;
    cursor: pointer;
}

.period-selector select:focus {
    outline: none;
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.period-info {
    color: #6a737d;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border-left: 4px solid #e2e8f0;
}

.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stat-card.primary {
    border-left-color: #4e73df;
}

.stat-card.success {
    border-left-color: #1cc88a;
}

.stat-card.warning {
    border-left-color: #f6c23e;
}

.stat-card.info {
    border-left-color: #36b9cc;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6a737d;
    margin: 0;
}

.stat-icon {
    font-size: 1.5rem;
    color: #cbd5e0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.stat-value small {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: #6a737d;
    margin-top: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6a737d;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-change.positive {
    color: #1cc88a;
}

.stat-change.negative {
    color: #e74c3c;
}

.stat-change i {
    margin-right: 0.25rem;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.quick-stat {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.quick-stat .stat-label {
    font-size: 0.875rem;
    color: #6a737d;
    margin-bottom: 0.5rem;
}

.quick-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

/* Chart Container (within cards) */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    max-height: 400px;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    white-space: nowrap;
}

.data-table td {
    color: #1a202c;
    font-size: 0.875rem;
}

.data-table tr:hover {
    background: #f8fafc;
}

.page-info {
    max-width: 300px;
}

.page-info strong {
    display: block;
    color: #1a202c;
    word-break: break-word;
}

.page-info small {
    color: #6a737d;
    font-size: 0.75rem;
}

.page-url {
    color: #4e73df;
    text-decoration: none;
}

.page-url:hover {
    text-decoration: underline;
}

.percentage {
    color: #6a737d;
    font-weight: 500;
}

.country-flag {
    margin-right: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6a737d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Text Utilities */
.text-muted {
    color: #6a737d !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Live Activity */
.live-activity {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.activity-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    color: #1cc88a;
    font-size: 0.875rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #1cc88a;
    border-radius: 50%;
    margin-right: 0.5rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.last-update {
    color: #6a737d;
    font-size: 0.75rem;
}

.activity-content {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    color: #4a5568;
}

.activity-details {
    flex: 1;
}

.activity-url {
    color: #4e73df;
    text-decoration: none;
    font-weight: 500;
}

.activity-url:hover {
    text-decoration: underline;
}

.activity-meta {
    color: #6a737d;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.activity-time {
    color: #6a737d;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Login Page */
.login-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 0.75rem;
    padding: 3rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6a737d;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: #4e73df;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-btn:hover {
    background: #2e59d9;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .header-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        transition: transform 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-container {
        position: relative;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-controls {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .period-selector,
    .site-selector {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .dashboard-overview {
        padding: 1rem;
    }
    
    .content-wrapper {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .stats-grid,
    .content-grid {
        margin: 1rem;
    }
    
    .stat-card,
    .card {
        margin: 0;
    }
    
    .chart-container {
        height: 300px;
        max-height: 300px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .nav-item a {
        padding: 0.5rem 1rem;
    }
}

/* Dashboard Overview */
.dashboard-overview {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.hidden { display: none; }
.visible { display: block; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

/* Error Messages */
.error-message {
    color: #e74c3c;
    background: #fdf2f2;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #fecaca;
    margin: 1rem 0;
}

.success-message {
    color: #16a34a;
    background: #f0fdf4;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #bbf7d0;
    margin: 1rem 0;
}

.warning-message {
    color: #d97706;
    background: #fffbeb;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #fed7aa;
    margin: 1rem 0;
}

/* Connection Status */
.connection-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #1a202c;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    z-index: 1000;
    white-space: nowrap;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a202c;
} 