/* =============================================
   WebAnalytics Dashboard Styles
   ============================================= */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #212529;
    --primary: #0d6efd;
    --accent: #6f42c1;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, margin-left 0.3s ease;
    overflow-y: auto;
}

#sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

#sidebar .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#sidebar .nav-link.active {
    background-color: var(--primary);
    border-radius: 0.25rem;
    margin: 0 0.5rem;
}

#sidebar .nav-link i {
    width: 1.5rem;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close {
    display: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar overlay (mobile backdrop) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Page content */
#page-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background-color: #f8f9fa;
}

#page-content.expanded {
    margin-left: 0;
}

/* KPI Cards */
.kpi-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kpi-card .card-body {
    padding: 1.25rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.kpi-change.positive {
    color: #198754;
}

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

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Chart containers */
.chart-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chart-card .card-header {
    background: white;
    border-bottom: 1px solid #eee;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 600;
}

/* Data tables */
.data-table {
    font-size: 0.9rem;
}

.data-table th {
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom-width: 2px;
}

.data-table td {
    vertical-align: middle;
}

/* Progress bars in tables */
.table-progress {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
}

.table-progress-bar {
    height: 100%;
    border-radius: 3px;
    background-color: var(--primary);
}

/* Tracking code box */
.tracking-code {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    position: relative;
}

.tracking-code .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* Login pagina */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* AI medium badge kleur */
.bg-purple { background-color: #6f42c1 !important; }

/* Real-time pulse animatie */
.realtime-pulse {
    width: 8px;
    height: 8px;
    background: #198754;
    border-radius: 50%;
    animation: pulse 2s infinite;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Cohort heatmap */
.cohort-cell {
    min-width: 60px;
}

/* =============================================
   Responsive: Tablet (< 992px)
   ============================================= */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        margin-left: 0 !important;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    #page-content {
        margin-left: 0 !important;
    }
}

/* =============================================
   Responsive: Phone landscape (< 768px)
   ============================================= */
@media (max-width: 767.98px) {
    .navbar .input-group {
        width: 100% !important;
    }

    .navbar .d-flex {
        width: 100%;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.5rem;
    }

    .data-table th {
        font-size: 0.7rem;
    }
}

/* =============================================
   Responsive: Phone portrait (< 576px)
   ============================================= */
@media (max-width: 575.98px) {
    main.p-4 {
        padding: 0.75rem !important;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .kpi-card .card-body {
        padding: 0.75rem;
    }

    .kpi-label {
        font-size: 0.75rem;
    }

    .chart-card .card-header {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .empty-state {
        padding: 2rem 0.75rem;
    }

    .empty-state i {
        font-size: 2rem;
    }

    h4 {
        font-size: 1.1rem;
    }
}
