/* Florijn V2.0 Sprint 7 — Polish CSS */

/* ═══ FORM STYLING CONSISTENT ═══ */
.form-group { margin-bottom: 10px; }
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text3, #4B6380);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-input, .form-select {
    width: 100%;
    background: var(--surface, #0D1520);
    border: 1px solid var(--border, #1A2A3C);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text1, #F1F5F9);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--ac, #EAB308);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15);
}
.form-input::placeholder { color: var(--text4, #334155); }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.form-input[type="color"] {
    padding: 4px;
    height: 40px;
    cursor: pointer;
}
textarea.form-input { min-height: 60px; resize: vertical; }
.required { color: var(--red, #EF4444); }

/* ═══ CARD POLISH ═══ */
.card {
    transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s;
}
.card-clickable:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.card-clickable:active {
    transform: translateY(0);
}

/* ═══ BUTTON POLISH ═══ */
.btn {
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}
.btn:active:not(:disabled) {
    transform: scale(0.97);
}
.btn-primary {
    background: linear-gradient(135deg, var(--ac, #EAB308), #D4A007);
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(234, 179, 8, 0.35);
}
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 10px;
    top: 50%;
    margin-top: -7px;
}

/* ═══ MODAL POLISH ═══ */
.modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
.modal-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #1A2A3C);
    margin-bottom: 12px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #1A2A3C);
    margin-top: 12px;
}

/* ═══ TOAST POLISH ═══ */
.toast {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ═══ PILL POLISH ═══ */
.pill {
    transition: all 0.15s;
    font-weight: 600;
}
.pill-clickable:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ═══ SKELETON LOADING ═══ */
.skeleton {
    background: linear-gradient(90deg, var(--surface, #0D1520) 25%, rgba(26,42,60,0.5) 50%, var(--surface, #0D1520) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card { height: 80px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 40%; margin-bottom: 12px; }
.skeleton-text { height: 14px; width: 70%; margin-bottom: 6px; }

/* ═══ ACCESSIBILITY ═══ */
:focus-visible {
    outline: 2px solid var(--ac, #EAB308);
    outline-offset: 2px;
}
.btn:focus-visible, .tab:focus-visible, .pill-clickable:focus-visible {
    outline: 2px solid var(--ac, #EAB308);
    outline-offset: 2px;
}
/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border, #1A2A3C); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text4, #334155); }

/* ═══ SELECTION ═══ */
::selection { background: rgba(234, 179, 8, 0.25); color: var(--text1); }

/* ═══ SMOOTH TRANSITIONS ═══ */
.page-content { scroll-behavior: smooth; }
.sidebar .nav-item { transition: all 0.15s ease; }
.sidebar .nav-item:hover { background: rgba(234, 179, 8, 0.06); }
.sidebar .nav-item.active {
    background: rgba(234, 179, 8, 0.1);
    box-shadow: inset 3px 0 0 var(--ac, #EAB308);
}

/* ═══ PROGRESS BAR POLISH ═══ */
.progress { border-radius: 4px; overflow: hidden; }
.progress-fill {
    transition: width 0.6s ease;
    border-radius: 4px;
}

/* ═══ STATUS BADGES ═══ */
.status { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.status-open { background: rgba(59,130,246,0.12); color: #3B82F6; }
.status-in_uitvoering { background: rgba(245,158,11,0.12); color: #F59E0B; }
.status-afgerond { background: rgba(34,197,94,0.12); color: #22C55E; }
.status-overdue { background: rgba(239,68,68,0.12); color: #EF4444; }
.status-betaald { background: rgba(34,197,94,0.12); color: #22C55E; }
.status-openstaand { background: rgba(59,130,246,0.12); color: #3B82F6; }

/* ═══ EMPTY STATE POLISH ═══ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; color: var(--text2); }
.empty-state-text { font-size: 13px; margin-bottom: 16px; max-width: 300px; margin-left: auto; margin-right: auto; }

/* ═══ HELPBOX POLISH ═══ */
.helpbox {
    background: rgba(234, 179, 8, 0.04);
    border: 1px solid rgba(234, 179, 8, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.helpbox-icon { flex-shrink: 0; color: var(--ac); }
.helpbox-text { font-size: 12px; color: var(--text3); line-height: 1.5; }

/* ═══ TRUNCATE ═══ */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ PRINT ═══ */
@media print {
    .sidebar, .mobile-nav, .fab, .header, .modal-overlay, .toast-container, .ctx-menu { display: none !important; }
    .page-content { margin: 0; padding: 16px; }
    .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
    body { background: white; color: black; }
    .btn { display: none; }
    * { color: black !important; background: white !important; }
}

/* ═══ ANIMATIONS ═══ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

/* Validation box */
.validation-box {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.validation-item {
    font-size: 12px;
    color: var(--red);
    padding: 2px 0;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══ FASE A: SIDEBAR VERBETERINGEN ═══ */

/* S6: Sidebar hover gradient + glow */
.sidebar .nav-item:hover {
    background: linear-gradient(90deg, rgba(234,179,8,0.08) 0%, transparent 100%);
    color: var(--text1);
}

/* S7: Active indicator gouden lijn links */
.sidebar .nav-item.active {
    background: linear-gradient(90deg, rgba(234,179,8,0.12) 0%, transparent 100%);
    border-left-color: var(--ac, #EAB308);
    box-shadow: inset 3px 0 0 var(--ac, #EAB308);
    color: var(--text1);
    font-weight: 700;
}

/* S11: Sidebar scrollbar onzichtbaar tot hover */
.sidebar-nav { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar-nav:hover { scrollbar-color: var(--border) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: var(--border); }

/* S15: Sidebar ALTIJD donker, ook in light mode */
body.light .sidebar {
    background: var(--sidebar, #0F1923) !important;
    color: var(--text2) !important;
}
body.light .sidebar .nav-item { color: var(--text2) !important; }
body.light .sidebar .nav-item:hover { color: var(--text1) !important; }
body.light .sidebar .nav-item.active { color: var(--text1) !important; }
body.light .sidebar .sidebar-logo-text { color: var(--text1) !important; }
body.light .sidebar .sidebar-footer { color: var(--text4) !important; }
body.light .sidebar .nav-separator { color: var(--text4) !important; }

/* S1: Collapsed state fixes */
.sidebar.collapsed { overflow: visible; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .nav-item-icon { margin: 0; }
.sidebar.collapsed .nav-item-label { display: none; }
.sidebar.collapsed .nav-separator { display: none; }
.sidebar.collapsed .sidebar-mode { display: none; }
.sidebar.collapsed .sidebar-mode-label { display: none; }
.sidebar.collapsed .sidebar-project-name { display: none; }
.sidebar.collapsed .sidebar-logo-text-wrap { display: none; }
.sidebar.collapsed .sidebar-footer-version { display: block; }
.sidebar.collapsed .sidebar-footer span:not(.sidebar-footer-version) { display: none; }

/* S10: Tooltip bij collapsed */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    background: var(--card, #111B27);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text1);
    white-space: nowrap;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Nav separator styling */
.nav-separator {
    margin: 4px 0 2px;
    padding: 0 14px;
}

/* S28: Sidebar animation */
.sidebar {
    transition: width 0.25s ease, min-width 0.25s ease;
}

/* ═══ FASE A: HEADER VERBETERINGEN ═══ */

/* H4: Breadcrumb */
.header-breadcrumb {
    font-size: 10px;
    color: var(--text4);
    margin-top: -2px;
}

/* H13: Header sticky met blur */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* H14: Header glow lijn */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(234,179,8,0.2), transparent);
}

/* H1: Quick-add styling */
.header-quick-input {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    color: var(--text1) !important;
    font-size: 12px !important;
    font-family: inherit !important;
    transition: width 0.2s, border-color 0.2s, box-shadow 0.2s !important;
}
.header-quick-input:focus {
    border-color: var(--ac) !important;
    box-shadow: 0 0 0 2px rgba(234,179,8,0.15) !important;
    outline: none !important;
}

/* H10: Avatar dropdown */
.avatar-dropdown {
    animation: slideDown 0.15s ease;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    backdrop-filter: blur(2px);
}
.sidebar-mobile {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 201;
    animation: slideRight 0.2s ease;
    overflow-y: auto;
}
@keyframes slideRight {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
