/* --- ULTIMATE OVERRIDE: Notification text and icon wrapping, no overflow --- */
.notification-item-custom, .notification-item-custom *, .notification-list-custom, .notification-list-custom * {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

.notification-item-custom {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.notification-item-custom .flex-grow-1, .notification-item-custom .pe-2 {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    overflow: hidden !important;
}

.notification-item-custom .mark-read-btn {
    flex-shrink: 0 !important;
    max-width: 2.5rem !important;
}

/* --- Table Dropdown Fix: Prevent clipping in responsive tables --- */
.table-responsive-dropdown {
    overflow: visible !important;
}

.table-responsive-dropdown .dropdown-menu {
    position: fixed !important;
    z-index: 1050 !important;
    max-height: 200px;
    overflow-y: auto;
}

/* Alternative: Use static overflow for subtask tables specifically */
.subtasks-table-container {
    overflow: visible !important;
}

.subtasks-table-container .table-responsive {
    overflow: visible !important;
}

/* Ensure dropdown menu is above other elements */
.subtasks-table-container .dropdown-menu {
    z-index: 1050;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075), 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
}

/* Task completion requirements tooltip styling */
.completion-requirements-icon {
    cursor: help;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.completion-requirements-icon:hover {
    opacity: 1;
}

/* Custom tooltip styling for completion requirements */
.tooltip.completion-requirements .tooltip-inner {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    max-width: 350px;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tooltip.completion-requirements .tooltip-arrow::before {
    border-top-color: #ffeaa7;
}

/* Improve tooltip z-index to appear above dropdowns */
.tooltip {
    z-index: 1070;
}

/* --- Notification Card & Dropdown: Force Wrapping and Prevent Overflow --- */
.notification-item-custom, .notification-list-custom, .notification-item-custom .flex-grow-1, .notification-item-custom .pe-2, .notification-item-custom p, .notification-item-custom span, .notification-item-custom small {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    min-width: 0;
    max-width: 100%;
    display: block;
}

.notification-item-custom {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0.5rem;
}

.notification-item-custom .mark-read-btn {
    flex-shrink: 0;
    position: relative;
    width: 28px;
    height: 28px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    color: #6c757d;
    padding: 0 !important;
    margin: 0;
}

.notification-item-custom .mark-read-btn:hover,
.dropdown-menu .mark-read-btn:hover,
.mark-read-btn:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.notification-item-custom .mark-read-btn:active,
.dropdown-menu .mark-read-btn:active,
.mark-read-btn:active {
    transform: scale(0.95);
}

.notification-item-custom .mark-read-btn i,
.dropdown-menu .mark-read-btn i,
.mark-read-btn i {
    font-size: 13px;
    margin: 0 !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    left: 0;
    top: 0;
}
/* Ensure notification dropdown items wrap and are responsive */
.dropdown-menu .notification-item-custom {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-line;
    max-width: 100vw;
    padding-right: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.dropdown-menu .notification-item-custom .mark-read-btn {
    margin-left: 0.5rem;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
}

/* Ensure buttons work in all notification contexts */
.dropdown-menu .mark-read-btn,
.notification-list-custom .mark-read-btn,
.list-group .mark-read-btn {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 6px !important;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #6c757d !important;
    transition: all 0.2s ease !important;
}

/* Add enhanced notification styling for better UX */
.notification-item-custom:not(.list-group-item) {
    background-color: rgba(255, 193, 7, 0.05);
    border-left: 3px solid #ffc107;
    padding-left: 12px;
}

.notification-item-custom:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.notification-item-custom .mark-read-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Override any Bootstrap button defaults for notification buttons */
button.mark-read-btn.btn {
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 13px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

button.mark-read-btn.btn:not(:disabled):not(.disabled) {
    cursor: pointer;
}

/* Force proper centering for all FontAwesome icons in mark-read buttons */
.mark-read-btn .fas {
    width: 100% !important;
    text-align: center !important;
    vertical-align: middle !important;
}
/* Custom styles for Progressive Day System */

:root {
    --primary-color: #0cc0df;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

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

/* Navigation Styles */
.bg-primary {
    background-color: var(--primary-color) !important;
}
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    padding: 1rem 1rem;
    border-radius: 0.25rem;
    margin: 1 0.1rem;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.99); /* A slightly less bright white for better balance */
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #fff;
    border-color: #f21a07;
    color: #f21a07;
    transform: translateY(-1px);
}

/* Form Styles */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
}

/* Table Styles */
.table {
    background-color: white;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badge Styles */
.badge {
    font-size: 0.75em;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
}

/* Task Priority Colors */
.priority-low {
    background-color: var(--secondary-color);
    color: white;
}

.priority-medium {
    background-color: var(--info-color);
    color: white;
}

.priority-high {
    background-color: var(--warning-color);
    color: black;
}

.priority-urgent {
    background-color: var(--danger-color);
    color: white;
    animation: pulse 2s infinite;
}

/* Task Status Colors */
span.task-status-badge.status-new {
    background-color: var(--secondary-color);
    color: white;
}

span.task-status-badge.status-pending {
    background-color: var(--info-color);
    color: white;
}

span.task-status-badge.status-pending-approval {
    background-color: #fd7e14 !important; /* A distinct orange for visibility */
    color: black !important;
}

span.task-status-badge.status-in-progress {
    background-color: var(--warning-color) !important;
    color: black !important;
}

span.task-status-badge.status-completed {
    background-color: var(--success-color);
    color: white;
}

span.task-status-badge.status-approved {
    background-color: #155724;
    color: white;
}

span.task-status-badge.status-rejected {
    background-color: var(--danger-color);
    color: white;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

/* Notification Styles */
.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: flex-start;
}
.notification-icon {
    margin-right: 12px;
    font-size: 1.3em;
    flex-shrink: 0;
    min-width: 28px;
    max-width: 32px;
    text-align: center;
    overflow: hidden;
}
.notification-content {
    flex: 1 1 0%;
    min-width: 0;
    color: #333;
    font-size: 0.97em;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}
.notification-title {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.notification-text {
    color: #555;
    font-size: 0.95em;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.notification-count {
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Comment Styles */
.comment-item {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-time {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.comment-content {
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .card-body {
        padding: 0.75rem;
    }
    .table-responsive {
        font-size: 0.95rem;
        overflow-x: auto;
    }
    .table {
        min-width: 600px;
    }
    .btn, .btn-group-vertical .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
        padding: 0.75rem 1rem;
    }
    .form-control, .form-select {
        font-size: 1.05rem;
        padding: 0.75rem 1rem;
    }
    .mb-3, .mb-4 {
        margin-bottom: 1rem !important;
    }
}

/* Animation Classes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}


/* Only disable pointer events for buttons and form controls when loading */
.loading,
.loading .btn,
.loading button,
.loading input,
.loading select,
.loading textarea {
    opacity: 0.6;
}
.loading .btn,
.loading button,
.loading input,
.loading select,
.loading textarea {
    pointer-events: none;
}

/* Custom Scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #121212;
        --bs-body-color: #ffffff;
    }

    .card {
        background-color: #1e1e1e;
        color: #ffffff;
    }

    .table {
        background-color: #1e1e1e;
        color: #ffffff;
    }

    .form-control {
        background-color: #2a2a2a;
        border-color: #404040;
        color: #ffffff;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-header {
        display: none !important;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
    }

    .container-fluid {
        max-width: 100%;
    }
}

/* Accessibility Improvements */
.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;
}

.focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }

    .card {
        border: 2px solid #000;
    }

    .form-control {
        border-width: 2px;
    }
}

/* Keyboard Shortcuts - Visual Feedback */
.table-focused {
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
    transition: all 0.2s ease;
}

.table-row-selected {
    background-color: rgba(0, 123, 255, 0.1) !important;
    border-left: 4px solid var(--primary-color) !important;
    box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.2);
    transition: all 0.2s ease;
}

.table-row-selected:hover {
    background-color: rgba(0, 123, 255, 0.15) !important;
}

/* Keyboard shortcuts help tooltip */
.keyboard-shortcuts-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 1050;
    max-width: 300px;
    display: none;
}

.keyboard-shortcuts-help.show {
    display: block;
}

.keyboard-shortcuts-help .shortcuts-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.keyboard-shortcuts-help .shortcuts-list li {
    margin-bottom: 4px;
    font-size: 0.8rem;
}

/* Keyboard shortcuts help tooltip */
.keyboard-shortcuts-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 1050;
    max-width: 300px;
    display: none;
}

.keyboard-shortcuts-help.show {
    display: block;
}

.keyboard-shortcuts-help .shortcuts-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.keyboard-shortcuts-help .shortcuts-list li {
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.keyboard-shortcuts-help .shortcuts-list kbd {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* Workload Chart Canvas Styles */
#workloadChart {
    max-width: 100%;
    max-height: 100%;
    height: 350px;
}

/* Overdue Chart Canvas Styles */
#overdueChart {
    max-width: 100%;
    max-height: 100%;
}

/* Workload Chart Spinner Styles */
.workload-spinner {
    height: 150px;
}

/* Overdue Chart Spinner Styles */
.overdue-spinner {
    height: 150px;
}

/* Utilization Chart Spinner Styles */
.utilization-spinner {
    height: 250px;
}

/* Workload Chart Container Styles */
.workload-chart-card {
    min-width: 500px;
    max-width: 100%;
    height: 600px;
}

.workload-input-group {
    max-width: 350px;
}

.workload-date-input {
    min-width: 0;
    width: 110px;
}

.workload-status-select {
    width: 120px;
    min-width: 0;
    z-index: 1051;
}

.workload-date-feedback {
    font-size: 0.95em;
}

.workload-card-body {
    height: 400px;
}

/* Utilization Chart Styles */
.utilization-input-group {
    max-width: 350px;
}

.utilization-date-input {
    min-width: 0;
    width: 110px;
}

.utilization-employee-filter {
    width: 180px;
}

.utilization-date-feedback {
    font-size: 0.95em;
}

.utilization-card-body {
    height: 300px;
}

/* Overdue Chart Styles */
.overdue-chart-card {
    min-width: 350px;
    max-width: 100%;
    height: 370px;
}

.overdue-input-group {
    max-width: 300px;
}

.overdue-date-input {
    min-width: 0;
    width: 110px;
}

.overdue-date-feedback {
    font-size: 0.95em;
}

.overdue-card-body {
    height: 270px;
}

/* Status Chart Styles */
.status-chart-card {
    min-width: 350px;
    max-width: 100%;
    height: 370px;
}

.status-input-group {
    max-width: 300px;
}

.status-date-input {
    min-width: 0;
    width: 110px;
}

.status-date-feedback {
    font-size: 0.95em;
}

.status-card-body {
    height: 270px;
}

#statusPieChart {
    max-width: 100%;
    max-height: 100%;
}

/* Capacity Chart Styles */
.capacity-chart-card {
    min-width: 350px;
    max-width: 100%;
    height: 370px;
}

.capacity-card-body {
    height: 270px;
}

#capacityDonutChart {
    max-width: 100%;
    max-height: 100%;
}


.pagination .page-item .page-link,
.pagination .page-item.active .page-link,
.pagination .page-item.disabled .page-link {
    /* display: block; removed to allow Bootstrap flex alignment */
    padding: 0.375rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #0d6efd;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}
.pagination .page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}