/* Custom CSS for Task Tracker */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors - Consistent Blue Theme */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;  /* Main Primary */
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Status Colors - Semantic and Accessible */
    --status-todo: #dc2626;      /* Red 600 */
    --status-todo-bg: #fef2f2;   /* Red 50 */
    --status-progress: #d97706;   /* Amber 600 */
    --status-progress-bg: #fffbeb; /* Amber 50 */
    --status-done: #059669;       /* Emerald 600 */
    --status-done-bg: #ecfdf5;    /* Emerald 50 */

    /* Priority Colors */
    --priority-urgent: #dc2626;   /* Red 600 */
    --priority-high: #ea580c;     /* Orange 600 */
    --priority-medium: #d97706;   /* Amber 600 */
    --priority-low: #6b7280;      /* Gray 500 */

    /* Neutral Colors */
    --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;

    /* Semantic Colors */
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --info: #0ea5e9;

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

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* General Styles */
body {
    background-color: var(--gray-50);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    font-weight: 400;
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

.card {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white !important;
    color: var(--gray-800) !important;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.card-body {
    color: var(--gray-800) !important;
    background-color: white !important;
}

.card-title {
    color: var(--gray-900) !important;
    font-weight: 600;
}

.card-text {
    color: var(--gray-700) !important;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: var(--primary-600) !important;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: rgba(255,255,255,0.9) !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255,255,255,0.9) !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 12px;
    margin-top: 8px;
    padding: 0.5rem 0;
    min-width: 220px;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.navbar-nav .dropdown-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 2px 8px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
}

.navbar-nav .dropdown-item:hover {
    background-color: var(--primary-500);
    color: white;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.navbar-nav .dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

.navbar-nav .dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0,0,0,0.1);
}


/* Notification Badge */
.navbar .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Progress Bars */
.progress {
    height: 8px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Task Type Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--gray-700);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-50);
}

/* Buttons */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--gray-700);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Cards */
.card-header {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    color: var(--gray-800);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Dashboard Cards */
.dashboard-card {
    transition: transform 0.2s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

/* Enhanced Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.status-badge.status-to_do {
    background: var(--status-todo-bg);
    color: var(--status-todo);
    border-color: var(--status-todo);
}

.status-badge.status-in_progress {
    background: var(--status-progress-bg);
    color: var(--status-progress);
    border-color: var(--status-progress);
}

.status-badge.status-done {
    background: var(--status-done-bg);
    color: var(--status-done);
    border-color: var(--status-done);
}

/* Legacy Status Colors for backward compatibility */
.status-to-do {
    color: var(--status-todo);
}

.status-in-progress {
    color: var(--status-progress);
}

.status-done {
    color: var(--status-done);
}

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

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

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

.priority-urgent {
    color: var(--priority-urgent);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Smooth Transitions */
.btn, .card, .nav-link, .form-control, .form-select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus States */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* CKEditor Styles */
.ck-editor__editable {
    min-height: 200px;
}

/* Google Drive Preview */
.google-drive-preview {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

/* Schema Code Display */
.schema-code {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Task Form Dynamic Fields */
.task-form-field {
    margin-bottom: 1rem;
}

.task-form-field.hidden {
    display: none;
}

/* Task Type Selection */
.form-select-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

/* Task Type Specific Fields Card */
#task-form-fields .card {
    border-left: 4px solid #0d6efd;
    transition: all 0.3s ease;
}

#task-form-fields .card:hover {
    border-left-color: #0a58ca;
    transform: translateX(2px);
}

#task-form-fields .card-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
}

#task-form-fields .card-header h5 {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Form Field Groups */
.form-field-group {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.form-field-group h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

/* Enhanced Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Task Type Field Animations */
.task-type-fields {
    animation: slideInUp 0.4s ease-out;
}

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

/* Loading State */
.loading-state {
    opacity: 0.6;
    pointer-events: none;
}

/* Form Validation States */
.is-valid {
    border-color: #198754;
}

.is-invalid {
    border-color: #dc3545;
}

/* Custom Checkbox and Radio Styles */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.375rem 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

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

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}


/* Main Content */
.main-content {
    margin-left: 0 !important;
    min-height: calc(100vh - 56px);
    background-color: #ffffff;
    padding: 0;
    width: 100%;
}

/* Collapse Animation */
.collapse {
    transition: height 0.3s ease;
}

.collapse .nav-link {
    transition: all 0.2s ease;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .container-fluid {
        padding: 1rem 0.75rem;
    }
    
    .dropdown-menu {
        font-size: 0.9rem;
    }
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .container-fluid {
        padding: 0.75rem 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .dropdown-menu {
        font-size: 0.85rem;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .navbar-brand {
        font-size: 1.4rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Notification Badge */
.navbar .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Footer */
.footer {
    margin-top: auto;
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6;
}

/* Content Spacing */
.container-fluid {
    padding: 2rem 1rem;
    animation: fadeInUp 0.6s ease-out;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

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

/* Card Enhancements */
.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}

.card-header {
    background-color: var(--primary-600);
    color: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    border: none;
}

/* Button Enhancements */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Table Enhancements */
.table {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background-color: #ffffff;
}

.table thead th {
    background-color: var(--primary-600);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 0.75rem;
}

.table tbody td {
    color: var(--gray-800);
    padding: 0.75rem;
    border-color: var(--gray-200);
    background-color: #ffffff;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

/* Form Enhancements */
.form-control {
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: var(--gray-800);
    font-weight: 400;
}

.form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    background-color: #ffffff;
}

.form-label {
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.form-select {
    background-color: #ffffff;
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
}

.form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Alert Enhancements */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    box-shadow: var(--shadow);
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.875rem;
}

h5 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

h6 {
    font-size: 1rem;
    margin-bottom: 0.625rem;
}

p {
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

.text-secondary {
    color: var(--gray-600) !important;
}

/* List Styling */
.list-group-item {
    background-color: #ffffff;
    border-color: var(--gray-200);
    color: var(--gray-800);
}

.list-group-item:hover {
    background-color: var(--gray-50);
}

/* Badge Styling */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Button Text Contrast */
.btn-primary {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
    font-weight: 500;
}

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

.btn-secondary {
    background-color: var(--gray-600);
    border-color: var(--gray-600);
    color: white;
    font-weight: 500;
}

.btn-outline-primary {
    color: var(--primary-600);
    border-color: var(--primary-600);
    font-weight: 500;
}

.btn-outline-primary:hover {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

/* Icon System - Unified Styling */
.fas, .far, .fab {
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

/* Icon Spacing - Consistent */
.icon-sm {
    font-size: 0.875rem;
    width: 16px;
    height: 16px;
    margin-right: 0.375rem;
}

.icon-md {
    font-size: 1rem;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
}

.icon-lg {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
}

.icon-xl {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    margin-right: 1rem;
}

/* Icon Colors - Consistent Theme */
.icon-primary {
    color: var(--primary-600);
}

.icon-success {
    color: var(--success);
}

.icon-warning {
    color: var(--warning);
}

.icon-danger {
    color: var(--error);
}

.icon-info {
    color: var(--info);
}

.icon-secondary {
    color: var(--gray-600);
}

.icon-muted {
    color: var(--gray-500);
}

.icon-white {
    color: white;
}

/* Icon Backgrounds - Circular */
.icon-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.icon-bg-sm {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    margin-right: 0.375rem;
}

.icon-bg-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.icon-bg-primary {
    background-color: var(--primary-600);
    color: white;
}

.icon-bg-success {
    background-color: var(--success);
    color: white;
}

.icon-bg-warning {
    background-color: var(--warning);
    color: var(--gray-900);
}

.icon-bg-danger {
    background-color: var(--error);
    color: white;
}

.icon-bg-info {
    background-color: var(--info);
    color: white;
}

.icon-bg-secondary {
    background-color: var(--gray-600);
    color: white;
}

.icon-bg-light {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

/* Card Icons */
.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}

.card-icon.primary {
    color: var(--primary-600);
}

.card-icon.success {
    color: var(--success);
}

.card-icon.warning {
    color: var(--warning);
}

.card-icon.danger {
    color: var(--error);
}

.card-icon.info {
    color: var(--info);
}

/* Button Icons */
.btn i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
    width: 14px;
    text-align: center;
}

.btn-sm i {
    margin-right: 0.25rem;
    font-size: 0.75rem;
    width: 12px;
}

.btn-lg i {
    margin-right: 0.5rem;
    font-size: 1rem;
    width: 16px;
}

/* Navigation Icons */
.nav-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.dropdown-item i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
    width: 14px;
    text-align: center;
}

/* Table Icons */
.table i {
    margin-right: 0.25rem;
    font-size: 0.875rem;
    width: 14px;
    text-align: center;
}

/* Fix disappearing elements and ensure proper visibility */
.card-header h5, .card-header h3, .card-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
}

.card-header i {
    margin-right: 0.5rem;
}

/* Ensure all icons are visible */
.fas, .far, .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Fix help section code display */
.alert-light pre code {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

/* Ensure code inline elements are visible */
code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    color: #e83e8c;
}

/* Fix timeline styling */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.timeline-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Fix button icon spacing */
.btn i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
    width: 14px;
    text-align: center;
}

/* Fix form label colors */
.form-label {
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Ensure consistent card styling */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .card-title {
    color: white !important;
}

.card-header i {
    color: white !important;
}

.card-body {
    background-color: #ffffff;
    color: var(--gray-800);
    padding: 1rem;
}

/* Fix list group items */
.list-group-item {
    border: 1px solid var(--gray-200);
    background-color: #ffffff;
    color: var(--gray-800);
}

.list-group-item:hover {
    background-color: var(--gray-50);
}

.list-group-item-action:hover {
    background-color: var(--gray-50);
}

/* Fix alert styling */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

/* Ensure important alerts are always visible */
.alert-danger,
.alert-warning,
.alert-light {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.alert-light {
    background-color: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-800);
}

/* Status Icons */
.status-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 0.375rem;
}

.status-icon i {
    margin-right: 0.25rem;
    font-size: 0.75rem;
    width: 12px;
}

/* Loading Icons */
.loading-icon {
    animation: spin 1s linear infinite;
}

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

/* Hover Effects for Icons */
.icon-hover:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Icon Alignment */
.icon-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-start {
    display: flex;
    align-items: center;
}

.icon-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 56px; /* Height of navbar */
    left: -250px;
    width: 250px;
    height: calc(100vh - 56px);
    background-color: var(--primary-600);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.1);
}

.sidebar-content {
    padding: 1rem 0;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    border-radius: 0;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.2);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .collapse .nav-link {
    padding: 0.5rem 1rem 0.5rem 2rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.sidebar .collapse .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.sidebar .collapse .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.15);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Chevron Rotation */
.sidebar .nav-link[data-bs-toggle="collapse"] i.fa-chevron-down {
    transition: transform 0.3s ease;
}

.sidebar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"] i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Mobile Responsive for Sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .main-content.sidebar-open {
        margin-left: 0;
    }
    
    .sidebar.active {
        left: 0;
    }
}

/* Desktop - Hide sidebar by default */
@media (min-width: 992px) {
    .sidebar {
        left: -250px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

/* Workorder Card Styles */
.workorder-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid var(--gray-200);
    background-color: white !important;
    color: var(--gray-800) !important;
}

.workorder-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.workorder-card .card-body {
    background-color: white !important;
    color: var(--gray-800) !important;
}

.workorder-card .card-header {
    background-color: var(--gray-100) !important;
    color: var(--gray-800) !important;
    border-bottom: 1px solid var(--gray-200) !important;
}

.workorder-card .card-title {
    color: var(--gray-900) !important;
}

.workorder-card .card-text {
    color: var(--gray-700) !important;
}

.workorder-card p {
    color: var(--gray-700) !important;
}

.workorder-card .text-muted {
    color: var(--gray-500) !important;
}

/* General card text color fixes */
.card p {
    color: var(--gray-700) !important;
}

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

.card .text-secondary {
    color: var(--gray-600) !important;
}

.card .text-dark {
    color: var(--gray-900) !important;
}

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

.card .text-white {
    color: white !important;
}

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

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

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

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

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

/* Card Header and Title Text Fixes */
.card-header {
    color: var(--gray-900) !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .card-title {
    color: var(--gray-900) !important;
    font-weight: 600 !important;
}

.card-header .badge {
    color: white !important;
}

.card-header .text-muted {
    color: var(--gray-600) !important;
}

.card-header .text-white {
    color: white !important;
}

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

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

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

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

.card-header .text-info {
    color: var(--info) !important;
}

/* Section Headers and Labels */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900) !important;
}

.section-header h4 {
    color: var(--gray-800) !important;
}

.card-title {
    color: var(--gray-900) !important;
    font-weight: 600 !important;
}

/* Progress Overview and other section titles */
.text-muted {
    color: var(--gray-600) !important;
}

/* Ensure all text in cards is readable */
.card strong {
    color: var(--gray-800) !important;
    font-weight: 600 !important;
}

.card span:not(.badge) {
    color: var(--gray-700) !important;
}

/* Badge text should be white */
.badge {
    color: white !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
    color: white !important;
}

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

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: var(--gray-900) !important;
}

.badge.bg-danger {
    background-color: var(--error) !important;
    color: white !important;
}

.badge.bg-primary {
    background-color: var(--primary-600) !important;
    color: white !important;
}

.workorder-id {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.workorder-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.meta-item i {
    width: 16px;
    text-align: center;
}

.progress {
    background-color: var(--gray-200);
}

.card-header {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--gray-700);
    background-color: var(--gray-100);
}

.table td {
    vertical-align: middle;
}

.badge {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .workorder-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .meta-item {
        font-size: 0.8rem;
    }
}

/* Editor Styles */
.editor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.editor-content {
    border: 1px solid var(--gray-300);
    min-height: 400px;
    border-radius: var(--radius);
}

.selection-group {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.selection-group label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 5px;
    display: block;
}

.selection-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: #ffffff;
    color: var(--gray-800);
}

.selection-group select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    outline: none;
}

/* Task List Styles */
.task-list-container {
    padding: 1.5rem;
    background: var(--gray-50);
    min-height: 100vh;
}

.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.task-list-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-600);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: var(--primary-700);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.task-filters {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
    margin: 0;
}

.filter-input {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: white;
    color: var(--gray-800);
    transition: all 0.2s ease;
}

.filter-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    outline: none;
}

.task-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.task-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-700));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-card:hover::before {
    opacity: 1;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

.task-id {
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.task-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status-to_do {
    background: var(--status-todo);
    color: white;
}

.badge-status-in_progress {
    background: var(--status-progress);
    color: var(--gray-900);
}

.badge-status-done {
    background: var(--status-done);
    color: white;
}

.badge-priority-urgent {
    background: var(--priority-urgent);
    color: white;
}

.badge-priority-high {
    background: var(--priority-high);
    color: white;
}

.badge-priority-medium {
    background: var(--priority-medium);
    color: var(--gray-900);
}

.badge-priority-low {
    background: var(--priority-low);
    color: white;
}

.badge-type {
    background: var(--gray-200);
    color: var(--gray-700);
}

.task-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.task-assignee i {
    width: 12px;
    text-align: center;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-card:hover .task-actions {
    opacity: 1;
}

.task-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.task-actions .btn:hover {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
    transform: translateY(-1px);
}

.bulk-mode {
    background: var(--primary-50);
    border: 2px solid var(--primary-200);
}

.bulk-mode .task-card {
    border-color: var(--primary-300);
}

.bulk-checkbox {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.bulk-actions-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-600);
    color: white;
    padding: 1rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.bulk-actions-bar.show {
    display: flex;
}

.bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bulk-actions-right {
    display: flex;
    gap: 0.5rem;
}

.bulk-action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.bulk-action-btn.danger {
    background: var(--error);
    border-color: var(--error);
}

.bulk-action-btn.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .task-list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .task-cards {
        grid-template-columns: 1fr;
    }
    
    .task-card {
        padding: 1rem;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .task-actions {
        opacity: 1;
        justify-content: center;
    }
    
    .bulk-actions-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .bulk-actions-left,
    .bulk-actions-right {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .task-list-container {
        padding: 1rem;
    }
    
    .task-list-header {
        padding: 1rem;
    }
    
    .task-filters {
        padding: 1rem;
    }
    
    .quick-action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}
