/**
 * Hooorus Custom Styles - Minimal & Beautiful
 * Apple-inspired minimal design with clean grayscale + subtle blue-gray accent
 */

/* =============================================================================
   DESIGN SYSTEM
   ============================================================================= */

/* Color Palette */
:root {
    /* Grays - Foundation */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Blue-Gray Accent - Subtle & Professional */
    --accent-50: #f0f9ff;
    --accent-100: #e0f2fe;
    --accent-200: #bae6fd;
    --accent-500: #0ea5e9;
    --accent-600: #0284c7;
    --accent-700: #0369a1;

    /* Semantic Colors - Muted */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-600);
    font-size: 1rem;
    line-height: 1.6;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    margin-bottom: var(--spacing-4);
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.025em;
    margin-bottom: var(--spacing-4);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-3);
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-3);
}

h5 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-2);
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

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

/* Text Colors */
.text-primary { color: var(--accent-500) !important; }
.text-secondary { color: var(--gray-500) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-400) !important; }

/* Background Colors */
.bg-gray-50 { background-color: var(--gray-50) !important; }
.bg-gray-100 { background-color: var(--gray-100) !important; }

/* Borders */
.border-gray-200 { border-color: var(--gray-200) !important; }
.border-gray-300 { border-color: var(--gray-300) !important; }

/* Rounded Corners */
.rounded-lg { border-radius: 12px !important; }
.rounded-md { border-radius: 8px !important; }
.rounded-sm { border-radius: 6px !important; }

/* =============================================================================
   STATISTICS CARDS - NEW MINIMAL DESIGN
   ============================================================================= */

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
    height: 100%;
}

.stat-card:hover {
    border-color: var(--accent-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1.5rem;
    color: var(--gray-300);
    opacity: 0.6;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem;
}

/* Remove Bootstrap's colored card backgrounds - we don't use them anymore */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-danger {
    background: white !important;
    color: inherit !important;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.15s ease;
    border: none;
}

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

.btn:active {
    transform: translateY(0);
}

.btn i {
    margin-right: 0.25rem;
}

/* Primary Button - Accent Color */
.btn-primary {
    background: var(--accent-500);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-600);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:focus {
    background: var(--accent-600);
    color: white;
    box-shadow: 0 0 0 3px var(--accent-50);
}

/* Secondary Button - Outlined */
.btn-secondary {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-secondary:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
    color: var(--gray-800);
}

.btn-secondary:focus {
    background: var(--gray-50);
    color: var(--gray-800);
    box-shadow: 0 0 0 3px var(--gray-100);
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger,
.btn-outline-danger {
    background: white;
    border: 1px solid #fca5a5;
    color: var(--danger);
}

.btn-danger:hover,
.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: var(--danger);
    color: var(--danger);
}

/* =============================================================================
   FORM ELEMENTS
   ============================================================================= */

.form-control {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.15s ease;
    color: var(--gray-900);
}

.form-control:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px var(--accent-50);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-select {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.form-select:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px var(--accent-50);
    outline: none;
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

/* =============================================================================
   BADGES
   ============================================================================= */

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.badge-primary,
.bg-primary {
    background: var(--accent-100) !important;
    color: var(--accent-700) !important;
}

.badge-success,
.bg-success {
    background: #d1fae5 !important;
    color: var(--success) !important;
}

.badge-info,
.bg-info {
    background: var(--accent-100) !important;
    color: var(--accent-700) !important;
}

.badge-warning,
.bg-warning {
    background: #fef3c7 !important;
    color: var(--warning) !important;
}

/* =============================================================================
   ALERTS
   ============================================================================= */

.alert {
    border-radius: 8px;
    border: 1px solid;
}

.alert-success {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: var(--success);
}

.alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: var(--danger);
}

.alert.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

/* =============================================================================
   MODALS
   ============================================================================= */

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem;
}

/* =============================================================================
   TABULATOR TABLE CUSTOMIZATION
   ============================================================================= */

#employee-table {
    background-color: white;
    font-size: 14px;
}

/* Header filters */
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {
    font-size: 12px;
    padding: 3px 5px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

/* Editable cell styling */
.tabulator-cell.tabulator-editing input {
    border: 2px solid var(--accent-500);
}

/* Clickable rows */
.tabulator-row:hover {
    background-color: var(--gray-50) !important;
    cursor: pointer;
}

/* Pagination styling */
.tabulator .tabulator-footer .tabulator-paginator {
    color: var(--gray-600);
}

.tabulator .tabulator-footer .tabulator-page.active {
    background-color: var(--accent-500);
    color: white;
}

/* =============================================================================
   SHIFT DETAILS EXPANSION
   ============================================================================= */

.shift-detail-row {
    background-color: var(--gray-50);
    border-left: 3px solid var(--accent-500);
    margin: 0;
    padding: 0;
    display: block !important;
    width: 100%;
}

.shift-details-content {
    padding: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

.shift-details-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-700);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.shift-card {
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.shift-card:last-child {
    margin-bottom: 0;
}

.shift-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.shift-segments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.segment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background-color: var(--gray-50);
    border-radius: 6px;
    font-size: 0.9rem;
}

.segment-time {
    font-weight: 500;
    color: var(--gray-700);
    min-width: 140px;
}

.segment-hours {
    color: var(--gray-500);
    min-width: 50px;
    font-weight: 500;
}

.segment-code {
    background-color: var(--accent-500);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

.segment-rate {
    color: var(--success);
    font-weight: 600;
    min-width: 60px;
}

.overtime-badge {
    background-color: #fef3c7;
    color: var(--warning);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: bold;
}

.expandable-row {
    transition: background-color 0.2s;
}

.expandable-row:hover {
    background-color: var(--gray-50);
}

.shift-expanded {
    background-color: var(--accent-50) !important;
}

/* =============================================================================
   LOADING & ANIMATIONS
   ============================================================================= */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: white;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

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

*:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}

/* =============================================================================
   MISCELLANEOUS
   ============================================================================= */

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--gray-400);
}

.tooltip {
    font-size: 0.875rem;
}

details summary {
    cursor: pointer;
    color: var(--accent-700);
    font-weight: 500;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

details summary:hover {
    background-color: var(--accent-50);
}

details[open] summary {
    margin-bottom: 0.75rem;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    body {
        background-color: white;
    }

    .btn,
    .accordion,
    .modal,
    #searchInput,
    #jobTypeFilter,
    #yearsFilter,
    #clearFilters {
        display: none !important;
    }

    .table {
        font-size: 10pt;
    }

    details {
        break-inside: avoid;
    }

    details[open] summary {
        display: none;
    }

    .shift-preview,
    .shift-card {
        background-color: white;
        border: 1px solid var(--gray-300);
    }
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    #employee-table {
        font-size: 13px;
    }

    .tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
        font-size: 11px;
    }

    .shift-details-content {
        padding: 1rem;
    }

    .shift-card {
        padding: 0.75rem;
    }

    .shift-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .segment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .segment-time,
    .segment-hours,
    .segment-code,
    .segment-rate {
        min-width: auto;
        width: 100%;
    }

    .btn {
        padding: 0.625rem 1.25rem;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
}
