/* ============================================================
   NetworkApp - Hoofdstijlen
   Mobile-first, Bootstrap 5 + eigen CSS variabelen
   ============================================================ */

/* ------------------------------------------------------------
   CSS VARIABELEN (worden per organisatie overschreven via inline style op <html>)
   ------------------------------------------------------------ */
:root {
    --na-primary:        #0d6efd;
    --na-primary-dark:   #0a58ca;
    --na-primary-light:  #cfe2ff;
    --na-secondary:      #6c757d;
    --na-success:        #198754;
    --na-danger:         #dc3545;
    --na-warning:        #ffc107;

    --na-bg:             #f8f9fa;
    --na-card-bg:        #ffffff;
    --na-border:         #dee2e6;
    --na-text:           #212529;
    --na-text-muted:     #6c757d;

    --na-sidebar-width:  260px;
    --na-topbar-height:  56px;
    --na-border-radius:  0.5rem;
    --na-shadow:         0 2px 8px rgba(0,0,0,0.08);
    --na-shadow-hover:   0 4px 16px rgba(0,0,0,0.14);

    --na-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ------------------------------------------------------------
   iOS PWA TIP
   ------------------------------------------------------------ */
.na-ios-tip-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
}
.na-ios-tip-arrow-top {
    top: -8px;
    border-bottom: 10px solid #1c1c1e;
}
.na-ios-tip-arrow-bottom {
    bottom: -8px;
    border-top: 10px solid #1c1c1e;
}

/* ------------------------------------------------------------
   BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--na-font);
    background-color: var(--na-bg);
    color: var(--na-text);
    font-size: 0.9375rem; /* 15px - fijn op mobiel */
    line-height: 1.5;
}

/* ------------------------------------------------------------
   TOPBAR (mobile navigatie)
   ------------------------------------------------------------ */
.na-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--na-topbar-height);
    background: var(--na-primary);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1030;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.na-topbar .na-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    flex: 1;
}

.na-topbar-title {
    font-weight: 600;
    font-size: 1rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.na-topbar .btn-icon {
    color: white;
}

.na-topbar .btn-icon:hover,
.na-topbar .btn-icon:focus {
    background: rgba(255,255,255,0.15) !important;
    outline: none;
}

/* Basis btn-icon (ook buiten topbar, bijv. sidebar sluitknop) */
.btn-icon {
    background: none;
    border: none;
    padding: 0.4rem;
    border-radius: var(--na-border-radius);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: background 0.15s;
    position: relative;
    color: var(--na-text);
}

.btn-icon:hover,
.btn-icon:focus {
    background: rgba(0,0,0,0.06);
    outline: none;
}

/* Notificatie badge */
.na-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--na-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}

/* ------------------------------------------------------------
   SIDEBAR (desktop)
   ------------------------------------------------------------ */
.na-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--na-sidebar-width);
    background: white;
    border-right: 1px solid var(--na-border);
    display: flex;
    flex-direction: column;
    z-index: 1035;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.na-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.na-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--na-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--na-topbar-height);
}

.na-sidebar-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--na-primary);
    text-decoration: none;
    flex: 1;
}

.na-nav-section {
    padding: 0.5rem 0;
}

.na-nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--na-text-muted);
    padding: 0.75rem 1rem 0.25rem;
}

.na-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--na-text);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.1s, color 0.1s;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.na-nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.na-nav-item:hover {
    background: var(--na-primary-light);
    color: var(--na-primary);
}

.na-nav-item.active {
    background: var(--na-primary-light);
    color: var(--na-primary);
    border-left-color: var(--na-primary);
    font-weight: 600;
}

/* Sidebar overlay (mobile) */
.na-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1019;
}

.na-sidebar-overlay.visible {
    display: block;
}

/* ------------------------------------------------------------
   HOOFDINHOUD
   ------------------------------------------------------------ */
.na-content {
    padding-top: calc(var(--na-topbar-height) + 1rem);
    padding-bottom: 5rem; /* ruimte voor mobiele bottom nav */
    min-height: 100vh;
}

/* ------------------------------------------------------------
   BOTTOM NAVIGATIE (mobiel)
   ------------------------------------------------------------ */
.na-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--na-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.4rem 0;
    z-index: 1025;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.na-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: var(--na-text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--na-border-radius);
    transition: color 0.15s;
    flex: 1;
    max-width: 80px;
    position: relative;
}

.na-bottom-nav-item i {
    font-size: 1.3rem;
}

.na-bottom-nav-item.active {
    color: var(--na-primary);
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.na-card {
    background: var(--na-card-bg);
    border-radius: var(--na-border-radius);
    border: 1px solid var(--na-border);
    box-shadow: var(--na-shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

.na-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.na-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--na-text);
    margin: 0;
}

/* ------------------------------------------------------------
   LEDENKAART
   ------------------------------------------------------------ */
.na-lid-kaart {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--na-card-bg);
    border-radius: var(--na-border-radius);
    border: 1px solid var(--na-border);
    text-decoration: none;
    color: var(--na-text);
    transition: box-shadow 0.15s, transform 0.15s;
    margin-bottom: 0.5rem;
}

.na-lid-kaart:hover {
    box-shadow: var(--na-shadow-hover);
    transform: translateY(-1px);
    color: var(--na-text);
}

.na-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--na-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--na-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.na-avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
}

.na-lid-naam {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.na-lid-bedrijf {
    font-size: 0.8rem;
    color: var(--na-text-muted);
}

/* ------------------------------------------------------------
   STATISTIEKEN TEGELS
   ------------------------------------------------------------ */
.na-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.na-stat-tegel {
    background: var(--na-card-bg);
    border-radius: var(--na-border-radius);
    border: 1px solid var(--na-border);
    padding: 1rem;
    text-align: center;
}

.na-stat-getal {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--na-primary);
    line-height: 1;
}

.na-stat-label {
    font-size: 0.75rem;
    color: var(--na-text-muted);
    margin-top: 0.25rem;
}

/* ------------------------------------------------------------
   FORMULIEREN
   ------------------------------------------------------------ */
.na-form-group {
    margin-bottom: 1rem;
}

.na-form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    color: var(--na-text);
}

.na-form-group .form-control,
.na-form-group .form-select {
    border-color: var(--na-border);
    border-radius: var(--na-border-radius);
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
}

.na-form-group .form-control:focus,
.na-form-group .form-select:focus {
    border-color: var(--na-primary);
    box-shadow: 0 0 0 3px var(--na-primary-light);
}

/* ------------------------------------------------------------
   KNOPPEN (icon-first)
   ------------------------------------------------------------ */
.btn-na {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--na-border-radius);
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}

.btn-na:active { transform: scale(0.97); }

.btn-na-primary {
    background: var(--na-primary);
    color: white;
}
.btn-na-primary:hover { background: var(--na-primary-dark); color: white; }

.btn-na-outline {
    background: transparent;
    color: var(--na-primary);
    border: 1px solid var(--na-primary);
}
.btn-na-outline:hover { background: var(--na-primary-light); }

/* FAB - Floating Action Button */
.na-fab {
    position: fixed;
    bottom: calc(60px + 1rem); /* boven bottom nav */
    right: 1rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--na-primary);
    color: white;
    border: none;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
}

.na-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    color: white;
}

/* ------------------------------------------------------------
   ALERTS / TOASTS
   ------------------------------------------------------------ */
.na-toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: calc(100% - 2rem);
    max-width: 400px;
}

/* ------------------------------------------------------------
   RESPONSIVE: Desktop (768px+)
   ------------------------------------------------------------ */
@media (min-width: 768px) {
    .na-sidebar {
        transform: translateX(0) !important;
        box-shadow: none;
    }

    .na-content {
        width: auto; /* override container-fluid's width:100% — prevents margin-left + 100vw overflow */
        margin-left: var(--na-sidebar-width);
        padding-top: calc(var(--na-topbar-height) + 1.5rem);
        padding-bottom: 2rem;
    }

    .na-topbar {
        left: var(--na-sidebar-width);
    }

    .na-bottom-nav {
        display: none;
    }

    .na-fab {
        bottom: 2rem;
    }

    .na-stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    #btn-sidebar-toggle,
    #btn-sidebar-close {
        display: none;
    }
}

/* ------------------------------------------------------------
   UTILITY
   ------------------------------------------------------------ */
.text-primary-na { color: var(--na-primary) !important; }
.bg-primary-na { background-color: var(--na-primary) !important; }
.border-primary-na { border-color: var(--na-primary) !important; }

.na-divider {
    border: none;
    border-top: 1px solid var(--na-border);
    margin: 1rem 0;
}

/* Zoekvraag badge */
.na-zoek-badge {
    display: inline-block;
    background: var(--na-primary-light);
    color: var(--na-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    border: 1px solid var(--na-primary);
}
