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

/* CSS Variables for Premium Calm Theme */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-prive: #0ea5e9;
    --accent-prive-bg: #e0f2fe;
    --accent-zakelijk: #6366f1;
    --accent-zakelijk-bg: #e0e7ff;
    
    --priority-high: #f97316;
    --priority-high-bg: #ffedd5;
    --priority-normal: #3b82f6;
    --priority-normal-bg: #eff6ff;
    --priority-low: #10b981;
    --priority-low-bg: #ecfdf5;
    --priority-ooit: #64748b;
    --priority-ooit-bg: #f1f5f9;
    
    --energy-positive: #10b981;
    --energy-neutral: #64748b;
    --energy-negative: #ef4444;

    --sidebar-width: 260px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optional Dark Mode (Based on system/settings) */
[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --border-color: #374151;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    
    --accent-prive-bg: rgba(14, 165, 233, 0.15);
    --accent-zakelijk-bg: rgba(99, 102, 241, 0.15);
    
    --priority-high-bg: rgba(249, 115, 22, 0.15);
    --priority-normal-bg: rgba(59, 130, 246, 0.15);
    --priority-low-bg: rgba(16, 185, 129, 0.15);
    --priority-ooit-bg: rgba(100, 116, 139, 0.15);
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: var(--transition);
}

/* Auth / Login Page Layout */
.auth-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 90%);
}

.auth-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-header {
    text-align: center;
}

.auth-logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent-zakelijk) 0%, var(--accent-prive) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-tagline {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Typography & Layout elements */
a {
    color: var(--accent-zakelijk);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-prive);
}

/* Main Dashboard Shell */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar Layout */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-zakelijk) 0%, var(--accent-prive) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu-item a:hover,
.sidebar-menu-item.active a {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.sidebar-menu-item.active a {
    font-weight: 600;
    border-left: 3px solid var(--accent-zakelijk);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--accent-zakelijk);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content Area */
.app-main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    transition: var(--transition);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-title-group h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-title-group p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* Standard Premium UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-zakelijk);
    color: white;
}
.btn-primary:hover {
    background-color: #4f46e5;
}

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

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

/* Inputs & Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-zakelijk);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Cards & Badges */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-prive {
    background-color: var(--accent-prive-bg);
    color: #0369a1;
}

.badge-zakelijk {
    background-color: var(--accent-zakelijk-bg);
    color: #4338ca;
}

/* Priority Badges */
.badge-high {
    background-color: var(--priority-high-bg);
    color: #c2410c;
}
.badge-normal {
    background-color: var(--priority-normal-bg);
    color: #1d4ed8;
}
.badge-low {
    background-color: var(--priority-low-bg);
    color: #047857;
}
.badge-ooit {
    background-color: var(--priority-ooit-bg);
    color: #475569;
}

/* Dashboard Metrics CSS */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-zakelijk);
}

.metric-card.prive::before {
    background-color: var(--accent-prive);
}

.metric-card.high-prio::before {
    background-color: var(--priority-high);
}

.metric-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Calm Alert top */
.calm-message {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.5s ease;
}

/* Focus block on Dashboard */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.focus-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.focus-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Task Cards */
.task-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.task-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* Blocker badge */
.blocker-tag {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
}

/* Kanban CSS Layout */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    flex-grow: 1;
}

.kanban-column {
    flex: 0 0 300px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 200px);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.kanban-column-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.kanban-column-count {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 150px;
    padding: 2px;
}

/* Dragging visual helpers */
.kanban-cards.drag-over {
    background-color: rgba(99, 102, 241, 0.05);
    border: 2px dashed var(--accent-zakelijk);
    border-radius: var(--radius-md);
}

.task-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-muted);
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--bg-primary);
}

/* History logs inside Modal */
.activity-log {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Responsive Table List */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: var(--bg-secondary);
    font-size: 14px;
}

.table th,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
}

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

.table tr:hover td {
    background-color: var(--bg-primary);
}

/* Quick search and filters bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    align-items: center;
}

.filter-input {
    flex-grow: 1;
}

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

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

/* Mobile drawer and responsiveness */
.sidebar-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100vw;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 15px 20px;
    }
    .sidebar-logo {
        margin-bottom: 0;
    }
    .sidebar-menu, .sidebar-footer {
        display: none;
    }
    .sidebar-menu.show, .sidebar-footer.show {
        display: flex;
        margin-top: 15px;
    }
    .sidebar-toggle {
        display: block;
    }
    .app-main {
        margin-left: 0;
        padding: 20px;
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .kanban-board {
        padding-bottom: 10px;
    }
}
