/**
 * Spranz Management Tool - Design System
 *
 * Centraal stylesheet voor alle modules
 * Gebaseerd op: Roboto (body), Milker (headers), #d62e6e (accent)
 *
 * @version 1.0
 * @date 2024-12-13
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================ */

:root {
    /* Colors - Primary */
    --color-accent: #d62e6e;
    --color-accent-hover: #b8255c;
    --color-accent-light: rgba(214, 46, 110, 0.1);

    /* Colors - Status */
    --color-success: #27ae60;
    --color-success-light: rgba(39, 174, 96, 0.7);
    --color-warning: #f39c12;
    --color-warning-light: rgba(243, 156, 18, 0.7);
    --color-error: #e74c3c;
    --color-error-light: rgba(231, 76, 60, 0.7);
    --color-info: #3498db;
    --color-info-light: rgba(52, 152, 219, 0.7);
    --color-new: #9b59b6;
    --color-new-light: rgba(155, 89, 182, 0.7);

    /* Colors - Neutrals */
    --color-text: #1f2748;
    --color-text-light: #6c757d;
    --color-text-muted: #adb5bd;
    --color-white: #ffffff;
    --color-background: #f8f9fa;
    --color-surface: #ffffff;
    --color-border: #dee2e6;
    --color-border-light: #e9ecef;
    --color-sidebar: #1f2748;

    /* Typography */
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-header: 'Milker', 'Georgia', serif;

    /* Font Sizes */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */

    /* Spacing */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Layout */
    --header-height: 64px;
    --footer-height: 48px;
    --sidebar-width: 280px;
    --max-content-width: 1600px;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal-backdrop: 9000;
    --z-modal: 9999;
}

/* ============================================
   FONTS
   ============================================ */

@font-face {
    font-family: 'Milker';
    src: url('/assets/fonts/Milker.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CSS RESET
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body { padding-top: 70px !important;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-header);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

/* ============================================
   HEADER
   ============================================ */

.main-header { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important;
    position: sticky;
    top: 0;
    z-index: var(--z-fixed);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.header-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-header);
    font-size: var(--text-2xl);
    color: var(--color-accent);
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-xl);
    font-weight: 700;
    text-decoration: none;
    text-transform: lowercase;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    color: var(--color-accent);
    background: var(--color-accent-light);
}

.nav-btn.active {
    color: var(--color-accent);
}

.nav-btn i {
    font-size: 1.1em;
}

.nav-btn span {
    display: inline;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-btn.logout {
    color: var(--color-text-light);
}

.nav-btn.logout:hover {
    color: var(--color-error);
    background: var(--color-error-light);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    padding: var(--space-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--text-2xl);
    color: var(--color-text);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md);
    flex-direction: column;
    gap: var(--space-xs);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-lg);
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.mobile-nav hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-sm) 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: var(--space-lg);
    width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */

.main-footer {
    background: var(--color-sidebar);
    color: var(--color-white);
    height: var(--footer-height);
}

.footer-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-container p {
    margin: 0;
    font-size: var(--text-sm);
}

.footer-version {
    color: var(--color-text-muted);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

/* Secondary Button */
.btn-secondary {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-background);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Tool Buttons (compact) - uit editor.md */
.tool-btn {
    height: 24px;
    padding: 0 6px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(31, 39, 72, 0.2);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: rgb(31, 39, 72);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.tool-btn:hover {
    background: #e0e0e0;
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Status Buttons */
.tool-btn.green { background: var(--color-success); color: white; border-color: var(--color-success); }
.tool-btn.gray { background: #95a5a6; color: white; border-color: #95a5a6; }
.tool-btn.orange { background: var(--color-warning); color: white; border-color: var(--color-warning); }
.tool-btn.teal { background: #16a085; color: white; border-color: #16a085; }
.tool-btn.purple { background: var(--color-new); color: white; border-color: var(--color-new); }
.tool-btn.red { background: var(--color-error); color: white; border-color: var(--color-error); }
.tool-btn.pink { background: var(--color-accent); color: white; border-color: var(--color-accent); }

/* ============================================
   TOOLBAR HEADERS (PDF Tool Style)
   ============================================ */

/* Toolbar Header - uit editor.md */
.toolbar-header {
    padding: 6px 10px;
    background: #e0e0e0;
    color: var(--color-accent);
    font-family: var(--font-header);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Toolbar Content */
.toolbar-content {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

/* Toolbar Checkbox - uit editor.md */
.toolbar-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-family: var(--font-body);
    padding: 3px 6px;
    background: #34495e;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    font-family: var(--font-header);
    font-size: var(--text-lg);
    color: var(--color-accent);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-light);
}

/* PDF Card (specific styling) */
.pdf-card {
    position: relative;
    padding: var(--space-sm);
}

.pdf-card:hover {
    transform: scale(1.02);
}

.pdf-card .preview {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-background);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.pdf-card .preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdf-card .status-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.pdf-card .status-badge.done { background: var(--color-success-light); color: white; }
.pdf-card .status-badge.attention { background: var(--color-warning-light); color: white; }
.pdf-card .status-badge.new { background: var(--color-new-light); color: white; }
.pdf-card .status-badge.open { background: rgba(149, 165, 166, 0.7); color: white; }

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--color-text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-light);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-error { background: var(--color-error-light); color: var(--color-error); }
.badge-info { background: var(--color-info-light); color: var(--color-info); }
.badge-new { background: var(--color-new-light); color: var(--color-new); }
.badge-accent { background: var(--color-accent-light); color: var(--color-accent); }

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: relative;
    width: 95%;
    max-width: 1600px;
    height: 90vh;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    z-index: var(--z-modal);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--text-xl);
    z-index: 1;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.modal-close:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   FILTER SECTION
   ============================================ */

.filter-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
}

.filter-section .search-input {
    flex: 1;
    min-width: 200px;
}

.filter-section .filter-select {
    min-width: 150px;
}

.filter-badges {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* PDF Browser Grid (responsive) */
.pdf-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(6, 1fr);
}

/* ============================================
   UTILITIES
   ============================================ */

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }

/* Spacing */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Display */
.d-flex { display: flex; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1400px) {
    .pdf-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .main-nav .nav-btn span {
        display: none;
    }

    .main-nav .nav-btn {
        padding: var(--space-sm);
    }

    .pdf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .main-nav,
    .user-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .pdf-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3,
    .grid-4,
    .grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .main-content {
        padding: var(--space-md);
    }

    .filter-section {
        flex-direction: column;
    }

    .filter-section .search-input,
    .filter-section .filter-select {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .pdf-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-6 {
        grid-template-columns: 1fr;
    }

    .pdf-card .preview {
        height: 150px;
    }
}

/* ============================================
   PAGE TITLE BAR
   ============================================ */

.page-title-bar {
    background: var(--color-white);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-accent);
    margin: 0;
    letter-spacing: -0.5px;
}

@media (max-width: 768px) {
    .page-title-bar {
        padding: var(--space-md);
    }

    .page-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .main-header,
    .main-footer,
    .mobile-nav,
    .filter-section,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        max-width: 100%;
        padding: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
