/**
 * DAD39 Nootdorp Uren Management - Custom Styling
 */

/* Reset and base styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--p-surface-0);
    color: var(--p-text-color);
    line-height: 1.6;
}

/* DAD39 Orange theme colors override */
:root {
    --p-primary-50: #fff7ed;
    --p-primary-100: #ffedd5;
    --p-primary-200: #fed7aa;
    --p-primary-300: #fdba74;
    --p-primary-400: #fb923c;
    --p-primary-500: #f97316; /* DAD39 brand orange */
    --p-primary-600: #ea580c;
    --p-primary-700: #c2410c;
    --p-primary-800: #9a3412;
    --p-primary-900: #7c2d12;
    --p-primary-950: #431407;
    
    --p-primary-color: var(--p-primary-500);
    --p-primary-contrast-color: #ffffff;
}

/* Layout styling */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--p-surface-200);
}

.app-content {
    flex: 1;
}

.app-sidebar {
    position: sticky;
    top: 72px; /* height of navbar */
    max-height: calc(100vh - 72px);
    overflow-y: auto;
}

/* Card styling */
.stats-card .p-card-content {
    padding: 1.5rem;
}

.stats-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Form styling */
.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--p-text-color);
}

/* Button styling */
.p-button {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.p-button:hover {
    transform: translateY(-1px);
}

.p-button.w-full {
    width: 100%;
}

.p-button.justify-start {
    justify-content: flex-start;
}

/* Table styling */
.uren-table .p-datatable-header {
    background: var(--p-surface-50);
    border: 1px solid var(--p-surface-200);
}

.uren-table .p-datatable-tbody > tr:hover {
    background: var(--p-surface-50);
}

/* Input styling */
.p-inputtext,
.p-calendar .p-inputtext,
.p-autocomplete .p-inputtext,
.p-dropdown,
.p-inputtextarea {
    border-radius: 6px;
    border: 1px solid var(--p-surface-300);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.p-inputtext:focus,
.p-calendar .p-inputtext:focus,
.p-autocomplete .p-inputtext:focus,
.p-dropdown:focus,
.p-inputtextarea:focus {
    border-color: var(--p-primary-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Calendar specific */
.p-calendar .p-datepicker {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.p-calendar .p-datepicker .p-datepicker-header {
    background: var(--p-primary-color);
    color: white;
    border-radius: 8px 8px 0 0;
}

/* AutoComplete */
.p-autocomplete-panel {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Toast styling */
.p-toast {
    z-index: 9999;
}

.p-toast .p-toast-message {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Login form styling */
.login-container {
    background: linear-gradient(135deg, var(--p-surface-50) 0%, var(--p-surface-100) 100%);
    min-height: 100vh;
}

.login-container .p-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .app-content {
        flex-direction: column;
    }
    
    .app-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--p-surface-200);
    }
    
    .app-sidebar .grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .p-datatable {
        font-size: 0.875rem;
    }
    
    .p-datatable .p-datatable-tbody > tr > td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .app-navbar {
        padding: 0.75rem 1rem;
    }
    
    .app-navbar h1 {
        font-size: 1.25rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .login-container .p-card {
        margin: 1rem;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.w-full {
    width: 100%;
}

.w-64 {
    width: 16rem;
}

.max-w-md {
    max-width: 28rem;
}

.h-8 {
    height: 2rem;
}

.h-16 {
    height: 4rem;
}

.min-h-screen {
    min-height: 100vh;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-primary {
    color: var(--p-primary-color);
}

.text-muted-color {
    color: var(--p-text-muted-color);
}

.bg-surface-50 {
    background-color: var(--p-surface-50);
}

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

.text-primary-contrast {
    color: var(--p-primary-contrast-color);
}

.border-round {
    border-radius: 6px;
}

.border-r {
    border-right: 1px solid var(--p-surface-200);
}

.border-surface-200 {
    border-color: var(--p-surface-200);
}

.shadow-2 {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --p-surface-0: #0f172a;
        --p-surface-50: #1e293b;
        --p-surface-100: #334155;
        --p-surface-200: #475569;
        --p-text-color: #f8fafc;
        --p-text-muted-color: #94a3b8;
    }
}

/* Print styles */
@media print {
    .app-navbar,
    .app-sidebar,
    .p-button,
    .p-paginator {
        display: none !important;
    }
    
    .app-content {
        flex-direction: column;
    }
    
    main {
        padding: 0;
    }
    
    .p-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ApexCharts passive event listener fix */
#hoursPerDayChart,
#hoursPerPersonChart,
#weeklyTrendChart,
#overtimeChart,
#berekeningChartUren,
#berekeningChartEind,
#berekeningChartVerdeling,
#berekeningChartTerugontvangst {
    touch-action: none;
}