/**
 * MijnRitRegistratie.nl - Vortex Dashboard Design
 * Modern sidebar layout met collapsible sections
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Primary Colors - Orange accent like Vortex */
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    
    /* Secondary Colors */
    --secondary: #6366f1;
    --secondary-dark: #4f46e5;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    
    /* Neutral Colors */
    --text: #1f2937;
    --text-light: #6b7280;
    --gray: #9ca3af;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    
    /* Sidebar */
    --sidebar-bg: #1f2937;
    --sidebar-text: #9ca3af;
    --sidebar-active: #f97316;
    --sidebar-hover: #374151;
    --sidebar-width: 260px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f9fafb;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==================== LAYOUT ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 8px 20px;
    margin-top: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

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

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sidebar-hover);
    border-radius: var(--radius-md);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-user-role {
    color: var(--gray);
    font-size: 0.75rem;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-header {
    background: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.page-title p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.25rem;
    margin-right: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    width: 280px;
    background: var(--light);
    transition: all 0.15s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
}

.header-user:hover {
    background: var(--border);
}

.content-wrapper {
    padding: 24px;
}

/* Legacy container support */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Legacy header hidden when using sidebar */
.header {
    display: none;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--light);
    border-color: var(--text-light);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow-xs);
}

.btn-success:hover {
    background: #059669;
}

.btn-info {
    background: var(--info);
    color: white;
    box-shadow: var(--shadow-xs);
}

.btn-info:hover {
    background: #0284c7;
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-xs);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.9375rem;
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card h2 {
    color: #1f2937;
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.card h3 {
    color: var(--text);
    margin: 0 0 12px 0;
    font-size: 1.0625rem;
    font-weight: 600;
}

/* ==================== STATS GRID (Vortex Style) ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card.secondary::before {
    background: var(--secondary);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value small {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 4px;
}

.stat-change.positive {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.15s;
    background: white;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.checkbox-group label {
    margin: 0;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--light);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.1s;
}

tbody tr:hover {
    background: var(--light);
}

/* ==================== COLLAPSIBLE SECTIONS ==================== */
.collapsible-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: var(--light);
    transition: background 0.15s;
    user-select: none;
}

.collapsible-header:hover {
    background: #e5e7eb;
}

.collapsible-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collapsible-title h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.collapsible-meta {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.collapsible-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.collapsible-section.collapsed .collapsible-toggle {
    transform: rotate(-90deg);
}

.collapsible-content {
    display: block;
}

.collapsible-section.collapsed .collapsible-content {
    display: none;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
    border-left: 3px solid;
    font-size: 0.875rem;
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #065f46;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: #1e40af;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.badge-success, .badge-high {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.badge-warning, .badge-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.badge-danger, .badge-low {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.badge-info {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
}

.badge-zakelijk {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

.badge-woon-werk {
    background: rgba(6, 182, 212, 0.15);
    color: #0891b2;
}

.badge-prive {
    background: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

/* ==================== CONFIDENCE INDICATORS ==================== */
.confidence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.confidence-high {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
}

.confidence-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

.confidence-low {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 24px 0;
    margin-top: 32px;
    color: var(--text-light);
    font-size: 0.8125rem;
}

/* ==================== UTILITIES ==================== */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .top-header {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 10px 12px;
    }
    
    .search-box {
        display: none;
    }
    
    .content-wrapper {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .card h2 {
        font-size: 1.1rem;
    }
    
    table {
        font-size: 0.8125rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 0.8125rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 1rem;
    }
    
    .page-title h1 {
        font-size: 1.25rem;
    }
    
    .page-title p {
        display: none;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-wrapper {
        padding: 8px;
    }
    
    .card {
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    
    .page-title h1 {
        font-size: 1rem;
    }
    
    th, td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

@media (max-width: 768px) {
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
}

/* ==================== INFO BOXES ==================== */
.info-box {
    background: var(--light);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.875rem;
}

.info-box strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.info-box.warning {
    border-left-color: var(--warning);
    background: rgba(217, 119, 6, 0.05);
}

.info-box.success {
    border-left-color: var(--success);
    background: rgba(5, 150, 105, 0.05);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}
