/* ============================================================================
   WebGestPro - CSS Design System
   ============================================================================ */

/* CSS Custom Properties - Theme Variables */
:root {
    /* ---- COLOR PALETTE ---- */
    --color-primary: #2563EB;
    --color-primary-light: #3B82F6;
    --color-primary-dark: #1E40AF;
    --color-success: #10B981;
    --color-success-light: #6EE7B7;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-danger-light: #FCA5A5;
    --color-secondary: var(--color-surface-2);

    /* ---- RGB FOR TRANSPARENCY ---- */
    --color-primary-rgb: 37, 99, 235;
    --color-secondary-rgb: 51, 65, 85;
    --color-success-rgb: 16, 185, 129;
    --color-warning-rgb: 245, 158, 11;
    --color-danger-rgb: 239, 68, 68;



    --color-bg: #0F172A;
    --color-bg-secondary: #0B1120;
    --color-surface: #1E293B;
    --color-surface-2: #334155;
    --color-surface-hover: #475569;

    --color-border: rgba(148, 163, 184, 0.15);
    --color-border-light: rgba(148, 163, 184, 0.08);
    --color-text: #F8FAFC;
    --color-text-muted: #94A3B8;
    --color-text-light: #CBD5E1;

    /* ---- STATUS COLORS (DARK THEME) ---- */
    --status-success-bg: rgba(16, 185, 129, 0.15);
    --status-success-text: #6EE7B7;
    --status-warning-bg: rgba(245, 158, 11, 0.15);
    --status-warning-text: #F59E0B;
    --status-danger-bg: rgba(239, 68, 68, 0.15);
    --status-danger-text: #FCA5A5;
    --status-info-bg: rgba(37, 99, 235, 0.15);
    --status-info-text: #60A5FA;
    --status-pending-bg: rgba(148, 163, 184, 0.15);
    --status-pending-text: #94A3B8;
    --status-paused-bg: rgba(148, 163, 184, 0.1);
    --status-paused-text: #64748B;

    /* ---- SPACING ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-10: 56px;
    --space-12: 64px;

    /* ---- TYPOGRAPHY ---- */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-md: 1.0625rem;
    /* 17px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.25rem;
    /* 20px */
    --font-size-2xl: 1.5rem;
    /* 24px */
    --font-size-3xl: 1.875rem;
    /* 30px */

    --font-weight-400: 400;
    --font-weight-500: 500;
    --font-weight-600: 600;
    --font-weight-700: 700;

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* ---- BORDER RADIUS ---- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ---- SHADOWS ---- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    /* ---- LAYOUT ---- */
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --max-content-width: 1400px;

    /* ---- TRANSITIONS ---- */
    --transition-fast: 150ms ease-out;
    --transition-normal: 300ms ease-out;
    --transition-slow: 500ms ease-out;

    /* ---- Z-INDEX ---- */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-tooltip: 1100;
}

/* Light Theme Variables */
[data-theme='light'] {
    --color-bg: #F8FAFC;
    --color-bg-secondary: #F1F5F9;
    --color-surface: #FFFFFF;
    --color-surface-2: #F1F5F9;
    --color-surface-hover: #E2E8F0;

    --color-border: rgba(148, 163, 184, 0.2);
    --color-border-light: rgba(148, 163, 184, 0.1);
    --color-text: #0F172A;
    --color-text-muted: #64748B;
    --color-text-light: #475569;

    /* ---- STATUS COLORS (LIGHT THEME) ---- */
    --status-success-bg: #DCFCE7;
    --status-success-text: #166534;
    --status-warning-bg: #FFEDD5;
    --status-warning-text: #9A3412;
    --status-danger-bg: #FEE2E2;
    --status-danger-text: #991B1B;
    --status-info-bg: #E0F2FE;
    --status-info-text: #075985;
    --status-pending-bg: #F1F5F9;
    --status-pending-text: #475569;
    --status-paused-bg: #F8FAFC;
    --status-paused-text: #64748B;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* UI Scaling Classes */
html.zoom-80 {
    font-size: 12.8px !important;
}

html.zoom-85 {
    font-size: 13.6px !important;
}

html.zoom-90 {
    font-size: 14.4px !important;
}

html.zoom-95 {
    font-size: 15.2px !important;
}

html.zoom-100 {
    font-size: 16px !important;
}

html.zoom-105 {
    font-size: 16.8px !important;
}

html.zoom-110 {
    font-size: 17.6px !important;
}

html.zoom-115 {
    font-size: 18.4px !important;
}

html.zoom-120 {
    font-size: 19.2px !important;
}

html.zoom-125 {
    font-size: 20px !important;
}

html.zoom-130 {
    font-size: 20.8px !important;
}

html.zoom-140 {
    font-size: 22.4px !important;
}

html.zoom-150 {
    font-size: 24px !important;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-600);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-lg);
}

h5 {
    font-size: var(--font-size-base);
}

h6 {
    font-size: var(--font-size-sm);
}

p {
    margin-bottom: var(--space-3);
}

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

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

code,
pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    background: var(--color-surface-2);
    color: var(--color-text-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

pre {
    padding: var(--space-4);
    overflow-x: auto;
    line-height: var(--line-height-relaxed);
}

/* Form elements */
input,
textarea,
select {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:disabled,
textarea:disabled,
select:disabled {
    background: var(--color-surface);
    opacity: 0.6;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

thead {
    background: var(--color-surface-2);
    border-bottom: 2px solid var(--color-border);
}

th {
    padding: var(--space-1) var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-600);
    color: var(--color-text-light);
}

td {
    padding: var(--space-1) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Lists */
ul,
ol {
    margin-left: var(--space-5);
    margin-bottom: var(--space-3);
}

li {
    margin-bottom: var(--space-2);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.grid {
    display: grid;
}

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

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

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

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

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

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.flex-3 {
    flex: 3;
}

.flex-1-5 {
    flex: 1.5;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.items-start {
    align-items: flex-start;
}

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

.items-end {
    align-items: flex-end;
}

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

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

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

.justify-end {
    justify-content: flex-end;
}

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

.text-right {
    text-align: right;
}

.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.font-500 {
    font-weight: var(--font-weight-500);
}

.font-600 {
    font-weight: var(--font-weight-600);
}

.font-700 {
    font-weight: var(--font-weight-700);
}

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

.text-success {
    color: var(--color-success) !important;
}

.text-warning {
    color: var(--color-warning) !important;
}

.text-danger {
    color: var(--color-danger) !important;
}

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

.text-light {
    color: var(--color-text-light) !important;
}

.p-1 {
    padding: var(--space-1) !important;
}

.p-2 {
    padding: var(--space-2) !important;
}

.px-2 {
    padding-left: var(--space-2) !important;
    padding-right: var(--space-2) !important;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

.w-30 {
    width: 30px;
}

.max-w-800 {
    max-width: 800px;
}

.max-w-100 {
    max-width: 100px;
}

.max-w-200 {
    max-width: 200px;
}

.min-h-600 {
    min-height: 600px;
}

.max-w-100 {
    max-width: 100px;
}

.p-2 {
    padding: var(--space-2);
}

.p-3 {
    padding: var(--space-3);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

/* ============================================================================
   SCROLLBAR STYLING (Webkit browsers)
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-surface-hover);
}

/* ============================================================================
   CALENDAR STYLES
   ============================================================================ */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calendar-header-cell {
    background: var(--color-surface-2);
    padding: var(--space-2);
    text-align: center;
    font-weight: var(--font-weight-600);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
}

.calendar-day {
    background: var(--color-surface);
    height: 150px;
    padding: var(--space-2);
    position: relative;
    transition: background var(--transition-fast);
    overflow-y: auto;
}

.calendar-day:hover {
    background: var(--color-surface-hover);
}

.calendar-day.other-month {
    background: var(--color-bg-secondary);
    opacity: 0.5;
}

.calendar-day.today {
    background: rgba(37, 99, 235, 0.05);
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

.calendar-day .day-number {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-600);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
    text-align: right;
}

.calendar-day.today .day-number {
    color: var(--color-primary);
    font-weight: var(--font-weight-700);
}

/* Events */
.calendar-event {
    font-size: 11px;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform var(--transition-fast);
    font-weight: var(--font-weight-600);
}

.calendar-event:hover {
    transform: scale(1.02);
    z-index: 10;
    position: relative;
}

.event-project {
    background: rgba(37, 99, 235, 0.15);
    color: var(--color-primary);
    border-left: 2px solid var(--color-primary);
}

.event-assignment {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border-left: 2px solid var(--color-success);
}

.event-assignment.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

/* Legend Indicators */
.legend-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
}

.legend-project {
    background: rgba(37, 99, 235, 0.2);
    border-left: 2px solid var(--color-primary);
}

.legend-assignment {
    background: rgba(16, 185, 129, 0.2);
    border-left: 2px solid var(--color-success);
}