/**
 * Typisch Thuis CMS Admin Panel
 * Clean, modern admin styling for non-technical staff
 */

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

/* ============================================================================
   DESIGN TOKENS — Typisch Thuis huisstijl 2026
   - Goud #F5A300 als primair accent
   - Donker blauwgrijs #2F474B als tekst
   - Wit + lichtgrijs als achtergrond
   - Montserrat als enige font
   ========================================================================== */

:root {
    /* Colors */
    --color-bg: #F7F8F8;
    --color-bg-light: #FFFFFF;
    --color-bg-dark: #2F474B;
    --color-bg-warm: #FBF8F2;
    --color-text: #2F474B;
    --color-text-light: #4A6065;
    --color-text-muted: #8A9CA0;
    --color-primary: #F5A300;
    --color-primary-dark: #D89A1D;
    --color-primary-soft: #FFF6E2;
    --color-accent: #D89A1D;
    --color-border: #E8E8E8;
    --color-border-soft: #F2F2F2;
    --color-success: #5A8C6B;
    --color-error: #C45B5B;
    --color-warning: #D89A1D;
    --color-info: #6B8FB3;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(47, 71, 75, 0.06);
    --shadow-md: 0 8px 24px -8px rgba(47, 71, 75, 0.12);
    --shadow-lg: 0 24px 48px -20px rgba(47, 71, 75, 0.18);
    --shadow-gold: 0 12px 28px -12px rgba(245, 163, 0, 0.45);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: 0.25s cubic-bezier(.2,.7,.2,1);
}

/* ============================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.admin-body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    display: flex;
    min-height: 100vh;
}

img,
picture {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

/* ============================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--color-bg-dark);
    color: var(--color-bg-light);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

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

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--color-accent);
}

.sidebar-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    color: var(--color-bg-light);
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--color-accent);
}

.nav-link.active {
    color: var(--color-bg-light);
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-action-link {
    display: block;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-bg-light);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.sidebar-action-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--color-accent);
}

.logout-link {
    background-color: rgba(196, 91, 91, 0.2);
}

.logout-link:hover {
    background-color: rgba(196, 91, 91, 0.4);
}

/* ============================================================================
   MAIN WRAPPER
   ========================================================================== */

.admin-wrapper {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================================
   TOP BAR
   ========================================================================== */

.admin-topbar {
    background-color: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* ============================================================================
   FLASH MESSAGES
   ========================================================================== */

.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

.flash-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid var(--color-success);
}

.flash-error {
    background-color: #FFEBEE;
    color: #C62828;
    border-left: 4px solid var(--color-error);
}

.flash-warning {
    background-color: #FFF3E0;
    color: #E65100;
    border-left: 4px solid var(--color-warning);
}

.flash-info {
    background-color: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid var(--color-info);
}

.flash-content {
    flex: 1;
    font-weight: 500;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    color: inherit;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.flash-close:hover {
    opacity: 1;
}

.close-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* ============================================================================
   CONTENT AREA
   ========================================================================== */

.admin-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================================
   CARDS & SECTIONS
   ========================================================================== */

.card {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.card-body {
    margin-bottom: 1rem;
}

.card-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ============================================================================
   FORMS
   ========================================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--color-error);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--color-text);
    background-color: var(--color-bg-light);
    transition: all var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

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

.form-select {
    cursor: pointer;
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-checkbox-group,
.form-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-checkbox-item,
.form-radio-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.form-help {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

/* Two Column Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* ============================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg-light);
}

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

.btn-secondary {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border-soft);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-danger {
    background-color: var(--color-error);
    color: var(--color-bg-light);
}

.btn-danger:hover {
    background-color: #A84A4A;
    box-shadow: var(--shadow-md);
}

.btn-success {
    background-color: var(--color-success);
    color: var(--color-bg-light);
}

.btn-success:hover {
    background-color: #4A7A5A;
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* ============================================================================
   TABLES
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table thead {
    background-color: #F5F3F0;
    border-bottom: 2px solid var(--color-border);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--color-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.table tbody tr {
    transition: background-color var(--transition);
}

.table tbody tr:hover {
    background-color: #FEFDFB;
}

.table tbody tr.unread {
    background-color: #FFFBF5;
}

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

/* ============================================================================
   BADGES & STATUS
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.badge-error {
    background-color: #FFEBEE;
    color: #C62828;
}

.badge-warning {
    background-color: #FFF3E0;
    color: #E65100;
}

.badge-info {
    background-color: #E3F2FD;
    color: #1565C0;
}

.badge-draft {
    background-color: #F3E5F5;
    color: #6A1B9A;
}

.badge-pending {
    background-color: #F1F8E9;
    color: #558B2F;
}

.badge-published {
    background-color: #E0F2F1;
    color: #00695C;
}

/* ============================================================================
   FILE UPLOADS
   ========================================================================== */

.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background-color: #FEFDFB;
}

.upload-zone:hover {
    border-color: var(--color-primary);
    background-color: #F5F3F0;
}

.upload-zone.dragover {
    border-color: var(--color-primary);
    background-color: rgba(139, 115, 85, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-text {
    color: var(--color-text);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-subtext {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.upload-input {
    display: none;
}

.file-preview {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #F5F3F0;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-preview-name {
    font-size: 0.95rem;
    color: var(--color-text);
    font-weight: 500;
}

.file-preview-image {
    max-width: 100px;
    max-height: 100px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

/* ============================================================================
   MODALS
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 40, 37, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--color-bg-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.modal-body {
    margin-bottom: 1.5rem;
    color: var(--color-text-light);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============================================================================
   TABS
   ========================================================================== */

.tabs-container {
    margin-bottom: 2rem;
}

.tabs-list {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--color-border);
    list-style: none;
}

.tab-link {
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-weight: 600;
}

.tab-link:hover {
    color: var(--color-text);
}

.tab-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ============================================================================
   SECTION BUILDER
   ========================================================================== */

.section-list {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.section-item {
    background-color: #F5F3F0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: grab;
    transition: all var(--transition);
}

.section-item.dragging {
    opacity: 0.5;
}

.section-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-item-title {
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.section-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-light);
    font-size: 1rem;
}

.section-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-error);
    font-size: 1rem;
}

.section-content {
    display: none;
}

.section-content.expanded {
    display: block;
}

/* ============================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-wrapper {
        margin-left: 200px;
    }

    .admin-content {
        padding: 1.5rem;
    }

    .topbar-title {
        font-size: 1.25rem;
    }

    .topbar-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.75rem;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 600px) {
    .admin-sidebar {
        position: absolute;
        width: 100%;
        height: auto;
        max-height: 300px;
        overflow-y: auto;
    }

    .admin-wrapper {
        margin-left: 0;
    }

    .topbar-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .tabs-list {
        flex-wrap: wrap;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .table {
        font-size: 0.8rem;
    }

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

/* ============================================================================
   HUISSTIJL VERFIJNINGEN — onderaan voor cascade-voorrang
   ============================================================================ */

/* Knoppen met huisstijl-glow */
.btn-primary {
    background-color: var(--color-primary) !important;
    color: white !important;
    border-radius: 999px !important;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: var(--shadow-gold);
    border: none !important;
    transition: transform .25s var(--transition), background-color .25s var(--transition), box-shadow .25s var(--transition);
}
.btn-primary:hover {
    background-color: var(--color-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -14px rgba(216,154,29,.55);
}
.btn-secondary {
    background-color: white;
    color: var(--color-text);
    border: 1px solid var(--color-border) !important;
    border-radius: 999px !important;
    font-weight: 500;
}
.btn-secondary:hover {
    background-color: var(--color-bg);
    border-color: var(--color-primary) !important;
    color: var(--color-primary);
}
.btn-danger {
    border-radius: 999px !important;
    font-weight: 600;
}

/* Sidebar accent links: nieuwe nav-link in goud */
.sidebar-nav .nav-link {
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background-color .2s, color .2s, transform .2s;
}
.sidebar-nav .nav-link:hover {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
}
.sidebar-nav .nav-link.active {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
    font-weight: 600;
    border-left: 3px solid var(--color-primary);
}

/* Cards */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}
.card-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
}
.card-title {
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -.01em;
}

/* Form inputs */
.form-input, .form-select, .form-textarea {
    border-radius: 8px;
    border: 1.5px solid var(--color-border);
    transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(245,163,0,.12);
}
.form-label {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: .85rem;
    letter-spacing: .02em;
}

/* Headings */
h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; }

/* Tables */
table thead tr {
    background-color: var(--color-bg);
}
table tbody tr:hover {
    background-color: var(--color-primary-soft);
}

/* Topbar: subtiel gold-accent op de logo */
.admin-header {
    border-bottom: 1px solid var(--color-border);
    background: white;
}
