/* Custom styles for CoreliaOS */

/* CSS Custom Properties for Theme System (shadcn-inspired) */
:root {
  /* Light theme colors */
  --background: 248 250 252;
  --foreground: 15 23 42;
  --card: 255 255 255;
  --card-foreground: 15 23 42;
  --popover: 255 255 255;
  --popover-foreground: 15 23 42;
  --primary: 15 118 110;
  --primary-foreground: 248 250 252;
  --secondary: 241 245 249;
  --secondary-foreground: 15 23 42;
  --muted: 241 245 249;
  --muted-foreground: 100 116 139;
  --accent: 241 245 249;
  --accent-foreground: 15 23 42;
  --destructive: 239 68 68;
  --destructive-foreground: 248 250 252;
  --border: 226 232 240;
  --input: 226 232 240;
  --ring: 15 118 110;
  --success: 34 197 94;
  --success-foreground: 248 250 252;
  --warning: 245 158 11;
  --warning-foreground: 15 23 42;
  --info: 59 130 246;
  --chart-1: 15 118 110;
  --chart-2: 59 130 246;
  --chart-3: 245 158 11;
  --chart-4: 239 68 68;
  --chart-5: 168 85 247;
  
  /* Radius */
  --radius: 0.5rem;
}

[data-theme="dark"] {
  /* Dark theme colors */
  --background: 2 6 12;
  --foreground: 248 250 252;
  --card: 3 7 24;
  --card-foreground: 248 250 252;
  --popover: 3 7 24;
  --popover-foreground: 248 250 252;
  --primary: 34 197 94;
  --primary-foreground: 2 6 23;
  --secondary: 30 41 59;
  --secondary-foreground: 248 250 252;
  --muted: 30 41 59;
  --muted-foreground: 148 163 184;
  --accent: 30 41 59;
  --accent-foreground: 248 250 252;
  --destructive: 239 68 68;
  --destructive-foreground: 248 250 252;
  --border: 30 41 59;
  --input: 30 41 59;
  --ring: 34 197 94;
  --success: 34 197 94;
  --success-foreground: 2 6 23;
  --warning: 245 158 11;
  --warning-foreground: 15 23 42;
  --info: 59 130 246;
  --chart-1: 34 197 94;
  --chart-2: 59 130 246;
  --chart-3: 245 158 11;
  --chart-4: 239 68 68;
  --chart-5: 168 85 247;
}

/* Auto theme detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Apply dark theme variables when system prefers dark and no theme is set */
    --background: 2 6 12;
    --foreground: 248 250 252;
    --card: 3 7 24;
    --card-foreground: 248 250 252;
    --popover: 3 7 24;
    --popover-foreground: 248 250 252;
    --primary: 34 197 94;
    --primary-foreground: 2 6 23;
    --secondary: 30 41 59;
    --secondary-foreground: 248 250 252;
    --muted: 30 41 59;
    --muted-foreground: 148 163 184;
    --accent: 30 41 59;
    --accent-foreground: 248 250 252;
    --destructive: 239 68 68;
    --destructive-foreground: 248 250 252;
    --border: 30 41 59;
    --input: 30 41 59;
    --ring: 34 197 94;
    --success: 34 197 94;
    --success-foreground: 2 6 23;
    --warning: 245 158 11;
    --warning-foreground: 15 23 42;
    --info: 59 130 246;
    --chart-1: 34 197 94;
    --chart-2: 59 130 246;
    --chart-3: 245 158 11;
    --chart-4: 239 68 68;
    --chart-5: 168 85 247;
  }
}

/* Base element styling using CSS variables */
* {
  border-color: rgb(var(--border));
}

html {
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  transition: background-color 0.2s ease, color 0.2s ease;
}


.card {
    background-color: rgb(var(--card));
    color: rgb(var(--card-foreground));
    border: 1px solid rgb(var(--border));
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: var(--radius);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.card-header {
    background-color: rgb(var(--muted) / 0.5);
    border-bottom: 1px solid rgb(var(--border));
    font-weight: 600;
    color: rgb(var(--card-foreground));
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.server-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: rgb(var(--success));
    color: rgb(var(--success-foreground));
}

.status-inactive {
    background-color: rgb(var(--muted));
    color: rgb(var(--muted-foreground));
}

.status-error {
    background-color: rgb(var(--destructive));
    color: rgb(var(--destructive-foreground));
}

.status-starting {
    background-color: rgb(var(--warning));
    color: rgb(var(--warning-foreground));
}

.status-stopping {
    background-color: rgb(var(--destructive) / 0.8);
    color: rgb(var(--destructive-foreground));
}

.server-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

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

.config-preview {
    background-color: rgb(var(--muted));
    border: 1px solid rgb(var(--border));
    border-radius: var(--radius);
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    max-height: 200px;
    overflow-y: auto;
    color: rgb(var(--foreground));
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgb(var(--muted));
    border-top: 2px solid rgb(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-action {
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.env-var-group {
    background-color: rgb(var(--muted));
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    color: rgb(var(--muted-foreground));
    transition: background-color 0.2s ease, color 0.2s ease;
}

.type-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-right: 0.5rem;
}

.python-icon {
    color: rgb(var(--chart-2));
}

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

.docker-icon {
    color: rgb(var(--chart-2));
}

.transport-icon {
    color: rgb(var(--primary));
}

.navbar-brand {
    font-weight: bold;
}

.footer {
    margin-top: auto;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .server-actions {
        opacity: 1;
    }
    
    .btn-action {
        font-size: 0.75rem;
        padding: 0.125rem 0.25rem;
    }
}

/* Modal improvements */
.modal-lg {
    max-width: 800px;
}

.config-section {
    border: 1px solid rgb(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgb(var(--muted));
    color: rgb(var(--foreground));
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.config-section h6 {
    color: rgb(var(--muted-foreground));
    margin-bottom: 0.75rem;
}

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

/* Notification system */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    pointer-events: auto;
    margin-bottom: 10px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
}

.notification.alert-success {
    border-left-color: rgb(var(--success));
}

.notification.alert-danger {
    border-left-color: rgb(var(--destructive));
}

.notification.alert-warning {
    border-left-color: rgb(var(--warning));
}

.notification.alert-info {
    border-left-color: rgb(var(--info));
}

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgb(var(--accent) / 0.1);
    transition: background-color 0.15s ease;
}

.table {
    color: rgb(var(--foreground));
    transition: color 0.2s ease;
}

.table th {
    color: rgb(var(--muted-foreground));
    border-bottom: 1px solid rgb(var(--border));
}

.table td {
    border-bottom: 1px solid rgb(var(--border) / 0.5);
}

/* Log viewer */
.log-viewer {
    background-color: rgb(var(--muted));
    color: rgb(var(--foreground));
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid rgb(var(--border));
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    max-height: 400px;
    overflow-y: auto;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.log-line {
    margin-bottom: 0.25rem;
}

.log-timestamp {
    color: rgb(var(--muted-foreground));
}

.log-level-error {
    color: rgb(var(--destructive));
}

.log-level-warning {
    color: rgb(var(--warning));
}

.log-level-info {
    color: rgb(var(--info));
}

.log-level-debug {
    color: rgb(var(--chart-5));
}

/* Cost Widget Styles */
.cost-widget {
    position: relative;
    display: inline-block;
    transition: all 0.2s ease-in-out;
    animation: none;
}

.cost-widget:hover {
    transform: scale(1.05);
}

.cost-widget .cost-loading {
    display: inline-block;
}

.cost-widget .cost-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

.cost-widget .cost-amount {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.cost-widget.bg-warning {
    color: rgb(var(--warning-foreground)) !important;
}

.cost-widget.bg-warning .cost-amount {
    color: rgb(var(--warning-foreground)) !important;
}

.cost-widget.bg-success .cost-amount {
    color: rgb(var(--success-foreground));
}

.cost-widget.bg-danger .cost-amount {
    color: rgb(var(--destructive-foreground));
}

.cost-widget.bg-dark .cost-amount {
    color: rgb(var(--background));
}

/* Cost dropdown enhancements */
.dropdown-menu .cost-summary-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.dropdown-menu .cost-summary-item:not(:last-child) {
    border-bottom: 1px solid rgb(var(--border));
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

.dropdown-menu .cost-summary-item .cost-label {
    color: rgb(var(--muted-foreground));
    font-weight: 500;
}

.dropdown-menu .cost-summary-item .cost-value {
    font-weight: 600;
    margin-left: auto;
}

.dropdown-menu .cost-summary-item .cost-value.monthly {
    color: rgb(var(--success));
}

.dropdown-menu .cost-summary-item .cost-value.daily {
    color: rgb(var(--chart-2));
}

.dropdown-menu .cost-summary-item .cost-value.updated {
    color: rgb(var(--muted-foreground));
    font-size: 0.75rem;
    font-weight: 400;
}

/* Cost widget pulse animation for updates */
.cost-widget.updating {
    animation: cost-pulse 0.8s ease-in-out;
}

@keyframes cost-pulse {
    0% {
        box-shadow: 0 0 0 0 rgb(var(--success) / 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgb(var(--success) / 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgb(var(--success) / 0);
    }
}

/* High spending alert animation */
.cost-widget.bg-danger {
    animation: cost-warning-pulse 2s ease-in-out infinite;
}

@keyframes cost-warning-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Mobile responsive cost widget */
@media (max-width: 768px) {
    .cost-widget {
        font-size: 0.5em !important;
        padding: 0.25rem 0.4rem !important;
    }
    
    .dropdown-menu .cost-summary-item {
        font-size: 0.8rem;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid rgb(var(--border));
    background-color: rgb(var(--background));
    color: rgb(var(--foreground));
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background-color: rgb(var(--accent));
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle .theme-icon {
    transition: transform 0.3s ease, opacity 0.2s ease;
    position: absolute;
}

.theme-toggle .theme-icon.hidden {
    transform: rotate(180deg);
    opacity: 0;
}

/* Dark mode specific overrides for Bootstrap components */
[data-theme="dark"] .navbar-dark {
    background-color: rgb(var(--card)) !important;
    border-bottom: 1px solid rgb(var(--border));
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link {
    color: rgb(var(--foreground)) !important;
}

[data-theme="dark"] .navbar-dark .navbar-nav .nav-link:hover {
    color: rgb(var(--primary)) !important;
}

[data-theme="dark"] .navbar-dark .navbar-brand {
    color: rgb(var(--foreground)) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: rgb(var(--popover));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--popover-foreground));
}

[data-theme="dark"] .dropdown-item {
    color: rgb(var(--popover-foreground));
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: rgb(var(--accent));
    color: rgb(var(--accent-foreground));
}

[data-theme="dark"] .dropdown-divider {
    border-color: rgb(var(--border));
}

[data-theme="dark"] .modal-content {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--card-foreground));
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid rgb(var(--border));
}

[data-theme="dark"] .modal-footer {
    border-top: 1px solid rgb(var(--border));
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* Enhanced Form elements in dark mode - darker backgrounds for better eye comfort */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-control-plaintext,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--foreground));
    transition: all 0.2s ease;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    background-color: rgb(var(--card));
    border-color: rgb(var(--ring));
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25);
    color: rgb(var(--foreground));
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: rgb(var(--muted-foreground));
    opacity: 0.8;
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] input:disabled,
[data-theme="dark"] textarea:disabled {
    background-color: rgb(var(--muted));
    color: rgb(var(--muted-foreground));
    opacity: 0.7;
}

/* Form check elements (checkboxes, radios) */
[data-theme="dark"] .form-check-input {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--primary));
}

[data-theme="dark"] .form-check-input:focus {
    border-color: rgb(var(--ring));
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25);
}

[data-theme="dark"] .form-check-input:checked {
    background-color: rgb(var(--primary));
    border-color: rgb(var(--primary));
}

/* Input groups */
[data-theme="dark"] .input-group-text {
    background-color: rgb(var(--muted));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--foreground));
}

/* Form labels */
[data-theme="dark"] .form-label,
[data-theme="dark"] label {
    color: rgb(var(--foreground));
}

/* Form text/help text */
[data-theme="dark"] .form-text {
    color: rgb(var(--muted-foreground));
}

/* Form floating labels */
[data-theme="dark"] .form-floating label {
    color: rgb(var(--muted-foreground));
}

[data-theme="dark"] .form-floating .form-control:focus ~ label,
[data-theme="dark"] .form-floating .form-control:not(:placeholder-shown) ~ label {
    color: rgb(var(--ring));
}

/* Switch/toggle styling */
[data-theme="dark"] .form-switch .form-check-input {
    background-color: rgb(var(--muted));
    background-image: none;
}

[data-theme="dark"] .form-switch .form-check-input:checked {
    background-color: rgb(var(--primary));
}

/* File inputs */
[data-theme="dark"] .form-control[type="file"] {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
}

[data-theme="dark"] .form-control[type="file"]::-webkit-file-upload-button {
    background-color: rgb(var(--muted));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--foreground));
}

/* Range inputs */
[data-theme="dark"] .form-range {
    background: transparent;
}

[data-theme="dark"] .form-range::-webkit-slider-track {
    background-color: rgb(var(--border));
}

[data-theme="dark"] .form-range::-webkit-slider-thumb {
    background-color: rgb(var(--primary));
    border: 2px solid rgb(var(--card));
}

[data-theme="dark"] .form-range::-moz-range-track {
    background-color: rgb(var(--border));
}

[data-theme="dark"] .form-range::-moz-range-thumb {
    background-color: rgb(var(--primary));
    border: 2px solid rgb(var(--card));
}

/* Auto theme detection for form elements */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .form-control,
  :root:not([data-theme]) .form-select,
  :root:not([data-theme]) .form-control-plaintext,
  :root:not([data-theme]) input[type="text"],
  :root:not([data-theme]) input[type="email"],
  :root:not([data-theme]) input[type="password"],
  :root:not([data-theme]) input[type="number"],
  :root:not([data-theme]) input[type="search"],
  :root:not([data-theme]) input[type="url"],
  :root:not([data-theme]) input[type="tel"],
  :root:not([data-theme]) input[type="date"],
  :root:not([data-theme]) input[type="datetime-local"],
  :root:not([data-theme]) input[type="time"],
  :root:not([data-theme]) textarea {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
    color: rgb(var(--foreground));
    transition: all 0.2s ease;
  }

  :root:not([data-theme]) .form-control:focus,
  :root:not([data-theme]) .form-select:focus,
  :root:not([data-theme]) input:focus,
  :root:not([data-theme]) textarea:focus {
    background-color: rgb(var(--card));
    border-color: rgb(var(--ring));
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25);
    color: rgb(var(--foreground));
  }

  :root:not([data-theme]) .form-control::placeholder,
  :root:not([data-theme]) input::placeholder,
  :root:not([data-theme]) textarea::placeholder {
    color: rgb(var(--muted-foreground));
    opacity: 0.8;
  }

  :root:not([data-theme]) .form-check-input {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
  }

  :root:not([data-theme]) .form-check-input:focus {
    border-color: rgb(var(--ring));
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25);
  }

  :root:not([data-theme]) .form-check-input:checked {
    background-color: rgb(var(--primary));
    border-color: rgb(var(--primary));
  }

  :root:not([data-theme]) .form-label,
  :root:not([data-theme]) .form-text {
    color: rgb(var(--foreground));
  }

  :root:not([data-theme]) .form-floating label {
    color: rgb(var(--muted-foreground));
  }

  :root:not([data-theme]) .form-floating .form-control:focus ~ label,
  :root:not([data-theme]) .form-floating .form-control:not(:placeholder-shown) ~ label {
    color: rgb(var(--ring));
  }
}

/* Alert components */
[data-theme="dark"] .alert-success {
    background-color: rgb(var(--success) / 0.1);
    border-color: rgb(var(--success) / 0.2);
    color: rgb(var(--success));
}

[data-theme="dark"] .alert-danger {
    background-color: rgb(var(--destructive) / 0.1);
    border-color: rgb(var(--destructive) / 0.2);
    color: rgb(var(--destructive));
}

[data-theme="dark"] .alert-warning {
    background-color: rgb(var(--warning) / 0.1);
    border-color: rgb(var(--warning) / 0.2);
    color: rgb(var(--warning));
}

[data-theme="dark"] .alert-info {
    background-color: rgb(var(--info) / 0.1);
    border-color: rgb(var(--info) / 0.2);
    color: rgb(var(--info));
}

/* Footer */
[data-theme="dark"] .bg-light,
[data-theme="dark"] footer.bg-light {
    background-color: rgb(var(--muted)) !important;
    color: rgb(var(--muted-foreground)) !important;
}

/* Auto theme footer for dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .bg-light,
  :root:not([data-theme]) footer.bg-light {
    background-color: rgb(var(--muted)) !important;
    color: rgb(var(--muted-foreground)) !important;
  }
}

/* Modal overrides for dark theme */
[data-theme="dark"] .modal-content {
    background-color: rgb(var(--card)) !important;
    color: rgb(var(--card-foreground)) !important;
    border: 1px solid rgb(var(--border)) !important;
}

/* Custom badge classes using CSS variables */
.badge-success-custom {
    background-color: rgb(var(--success));
    color: white;
}

.badge-muted-custom {
    background-color: rgb(var(--muted));
    color: rgb(var(--muted-foreground));
}

.badge-destructive-custom {
    background-color: rgb(var(--destructive));
    color: white;
}

.badge-warning-custom {
    background-color: rgb(var(--warning));
    color: rgb(var(--warning-foreground));
}

.badge-dark-custom {
    background-color: rgb(var(--foreground));
    color: rgb(var(--background));
}

.badge-info-custom {
    background-color: rgb(var(--info));
    color: white;
}

.badge-primary-custom {
    background-color: rgb(var(--primary));
    color: white;
}

[data-theme="dark"] .modal-header {
    background-color: rgb(var(--muted)) !important;
    color: rgb(var(--foreground)) !important;
    border-bottom: 1px solid rgb(var(--border)) !important;
}

[data-theme="dark"] .modal-footer {
    background-color: rgb(var(--muted)) !important;
    border-top: 1px solid rgb(var(--border)) !important;
}

[data-theme="dark"] .modal-body {
    background-color: rgb(var(--card)) !important;
    color: rgb(var(--card-foreground)) !important;
}

/* Specific styling for Task Information textarea in dark mode - with higher specificity */
[data-theme="dark"] .modal-body #editTaskInfo,
[data-theme="dark"] #editTaskModal #editTaskInfo,
[data-theme="dark"] textarea#editTaskInfo,
[data-theme="dark"] .form-control#editTaskInfo {
    background-color: rgb(15 23 42) !important;  /* Darker background for better contrast */
    color: rgb(248 250 252) !important;  /* Light text */
    border: 1px solid rgb(51 65 85) !important;  /* Visible border */
}

[data-theme="dark"] .modal-body #editTaskInfo:focus,
[data-theme="dark"] #editTaskModal #editTaskInfo:focus,
[data-theme="dark"] textarea#editTaskInfo:focus,
[data-theme="dark"] .form-control#editTaskInfo:focus {
    background-color: rgb(15 23 42) !important;
    border-color: rgb(var(--ring)) !important;
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25) !important;
    color: rgb(248 250 252) !important;
    outline: none !important;
}

[data-theme="dark"] #editTaskInfo::placeholder {
    color: rgb(148 163 184) !important;  /* Muted placeholder text */
    opacity: 1 !important;
}

/* Also target the description textarea for consistency */
[data-theme="dark"] .modal-body #editTaskDescription,
[data-theme="dark"] #editTaskModal #editTaskDescription,
[data-theme="dark"] textarea#editTaskDescription,
[data-theme="dark"] .form-control#editTaskDescription {
    background-color: rgb(15 23 42) !important;
    color: rgb(248 250 252) !important;
    border: 1px solid rgb(51 65 85) !important;
}

[data-theme="dark"] .modal-body #editTaskDescription:focus,
[data-theme="dark"] #editTaskModal #editTaskDescription:focus,
[data-theme="dark"] textarea#editTaskDescription:focus,
[data-theme="dark"] .form-control#editTaskDescription:focus {
    background-color: rgb(15 23 42) !important;
    border-color: rgb(var(--ring)) !important;
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25) !important;
    color: rgb(248 250 252) !important;
    outline: none !important;
}

/* Auto theme modals for dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .modal-content {
    background-color: rgb(var(--card)) !important;
    color: rgb(var(--card-foreground)) !important;
    border: 1px solid rgb(var(--border)) !important;
  }
  
  /* Auto theme for Task Information textarea with higher specificity */
  :root:not([data-theme]) .modal-body #editTaskInfo,
  :root:not([data-theme]) #editTaskModal #editTaskInfo,
  :root:not([data-theme]) textarea#editTaskInfo,
  :root:not([data-theme]) .form-control#editTaskInfo {
    background-color: rgb(15 23 42) !important;
    color: rgb(248 250 252) !important;
    border: 1px solid rgb(51 65 85) !important;
  }
  
  :root:not([data-theme]) .modal-body #editTaskInfo:focus,
  :root:not([data-theme]) #editTaskModal #editTaskInfo:focus,
  :root:not([data-theme]) textarea#editTaskInfo:focus,
  :root:not([data-theme]) .form-control#editTaskInfo:focus {
    background-color: rgb(15 23 42) !important;
    border-color: rgb(var(--ring)) !important;
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25) !important;
    color: rgb(248 250 252) !important;
    outline: none !important;
  }
  
  :root:not([data-theme]) #editTaskInfo::placeholder {
    color: rgb(148 163 184) !important;
    opacity: 1 !important;
  }
  
  /* Auto theme for Description textarea */
  :root:not([data-theme]) .modal-body #editTaskDescription,
  :root:not([data-theme]) #editTaskModal #editTaskDescription,
  :root:not([data-theme]) textarea#editTaskDescription,
  :root:not([data-theme]) .form-control#editTaskDescription {
    background-color: rgb(15 23 42) !important;
    color: rgb(248 250 252) !important;
    border: 1px solid rgb(51 65 85) !important;
  }
  
  :root:not([data-theme]) .modal-body #editTaskDescription:focus,
  :root:not([data-theme]) #editTaskModal #editTaskDescription:focus,
  :root:not([data-theme]) textarea#editTaskDescription:focus,
  :root:not([data-theme]) .form-control#editTaskDescription:focus {
    background-color: rgb(15 23 42) !important;
    border-color: rgb(var(--ring)) !important;
    box-shadow: 0 0 0 0.125rem rgb(var(--ring) / 0.25) !important;
    color: rgb(248 250 252) !important;
    outline: none !important;
  }
  
  :root:not([data-theme]) .modal-header {
    background-color: rgb(var(--muted)) !important;
    color: rgb(var(--foreground)) !important;
    border-bottom: 1px solid rgb(var(--border)) !important;
  }
  
  :root:not([data-theme]) .modal-footer {
    background-color: rgb(var(--muted)) !important;
    border-top: 1px solid rgb(var(--border)) !important;
  }
  
  :root:not([data-theme]) .modal-body {
    background-color: rgb(var(--card)) !important;
    color: rgb(var(--card-foreground)) !important;
  }
}

/* Button overrides */
.btn-primary {
    background-color: rgb(var(--primary));
    border-color: rgb(var(--primary));
    color: rgb(var(--primary-foreground));
}

.btn-primary:hover {
    background-color: rgb(var(--primary) / 0.9);
    border-color: rgb(var(--primary) / 0.9);
}

.btn-secondary {
    background-color: rgb(var(--secondary));
    border-color: rgb(var(--secondary));
    color: rgb(var(--secondary-foreground));
}

.btn-secondary:hover {
    background-color: rgb(var(--secondary) / 0.8);
    border-color: rgb(var(--secondary) / 0.8);
}

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

.btn-outline-primary:hover {
    background-color: rgb(var(--primary));
    color: rgb(var(--primary-foreground));
}

/* Badge components */
.badge {
    transition: all 0.2s ease;
}

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

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

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

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

/* =================================== */
/* SIDEBAR NAVIGATION STYLES */
/* =================================== */

.sidebar {
    width: 280px;
    height: 100vh;
    background-color: rgb(var(--card));
    border-right: 1px solid rgb(var(--border));
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgb(var(--border));
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: rgb(var(--foreground));
    font-size: 1.1rem;
    transition: opacity 0.3s ease;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: rgb(var(--primary));
}

.sidebar.collapsed .sidebar-brand .brand-text {
    display: none;
}

.sidebar-brand .version-text {
    margin-left: 0.5rem;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.5;
    color: rgb(var(--muted-foreground));
}

.sidebar.collapsed .sidebar-brand .version-text {
    display: none;
}

.sidebar.collapsed .sidebar-brand i {
    display: none;
}

.sidebar-toggle {
    border: none;
    background: none;
    color: rgb(var(--muted-foreground));
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: rgb(var(--accent));
    color: rgb(var(--foreground));
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgb(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgb(var(--accent));
    color: rgb(var(--accent-foreground));
    text-decoration: none;
}

.nav-item.active {
    background-color: rgb(var(--primary) / 0.1);
    color: rgb(var(--primary));
    border-right: 3px solid rgb(var(--primary));
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-item {
    padding: 0.75rem;
    justify-content: center;
}

.nav-divider {
    height: 1px;
    background-color: rgb(var(--border));
    margin: 0.5rem 1rem;
}

.sidebar.collapsed .nav-divider {
    margin: 0.5rem;
}

/* Removed submenu/accordion styles - admin links now display directly */

/* Cost widget in sidebar */
.sidebar .cost-widget {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.cost-summary {
    font-size: 0.75rem;
    border-top: 1px solid rgb(var(--border));
    margin-top: 0.5rem;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgb(var(--border));
    margin-top: auto;
}

.user-dropdown {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    color: rgb(var(--foreground));
    border: none;
    background: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
    text-decoration: none;
}

.user-dropdown:hover,
.user-dropdown:focus {
    text-decoration: none;
}

.user-dropdown:hover {
    background-color: rgb(var(--accent));
    border-radius: 0.375rem;
}

.user-dropdown i.fas.fa-user-circle {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: rgb(var(--primary));
}

.user-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .user-name,
.sidebar.collapsed .user-dropdown i.fas.fa-chevron-up {
    display: none;
}

.sidebar.collapsed .user-dropdown {
    justify-content: center;
}

/* =================================== */
/* MAIN CONTENT AREA STYLES */
/* =================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: rgb(var(--background));
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

.top-bar {
    background-color: rgb(var(--card));
    border-bottom: 1px solid rgb(var(--border));
    padding: 1rem 2.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72.8px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-toggle {
    border: none;
    background: none;
    color: rgb(var(--foreground));
    font-size: 1.2rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: rgb(var(--foreground));
}

.page-title i {
    padding-right: 4px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* WebSocket Status Indicator */
.ws-status-indicator {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    cursor: help;
}

.ws-status-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgb(var(--muted));
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

/* Connected state - green */
.ws-status-indicator.connected .status-dot {
    background-color: rgb(var(--success));
    box-shadow: 0 0 0 2px rgba(var(--success), 0.2);
    animation: pulse-connected 2s ease-in-out infinite;
}

/* Disconnected state - red */
.ws-status-indicator.disconnected .status-dot,
.ws-status-indicator.error .status-dot {
    background-color: rgb(var(--destructive));
    box-shadow: 0 0 0 2px rgba(var(--destructive), 0.2);
    animation: pulse-error 2s ease-in-out infinite;
}

/* Warning state - yellow (no heartbeat) */
.ws-status-indicator.warning .status-dot {
    background-color: rgb(var(--warning));
    box-shadow: 0 0 0 2px rgba(var(--warning), 0.2);
    animation: pulse-warning 2s ease-in-out infinite;
}

/* Pulse animations */
@keyframes pulse-connected {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes pulse-error {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

.content-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* =================================== */
/* TRELLO BOARD STYLES */
/* =================================== */

.trello-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    min-height: 600px;
}

.trello-column {
    flex: 0 0 350px;
    background-color: transparent;
    border-radius: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    border: none;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgb(var(--border));
}

.column-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: rgb(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-count {
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

/* Status-specific column count colors */
.column-count-pending {
    background-color: rgb(var(--muted));
    color: rgb(var(--muted-foreground));
}

.column-count-running {
    background-color: rgb(var(--warning));
    color: rgb(var(--warning-foreground));
}

.column-count-completed {
    background-color: rgb(var(--success));
    color: rgb(var(--success-foreground));
}

.column-count-failed {
    background-color: rgb(var(--destructive));
    color: rgb(var(--destructive-foreground));
}

.column-count-cancelled {
    background-color: #8b5cf6; /* Violet color */
    color: white;
}

.column-header .view-all-link {
    color: rgb(var(--primary));
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.column-header .view-all-link:hover {
    opacity: 1;
}

.column-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.task-card {
    background-color: rgb(var(--card));
    border: 1px solid rgb(var(--border));
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgb(var(--primary));
}

.task-card .card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgb(var(--foreground));
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

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

.task-card .card-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.task-card .card-tag.department {
    background-color: rgb(var(--muted));
    color: rgb(var(--muted-foreground));
}

.task-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(var(--border));
    font-size: 0.8rem;
    color: rgb(var(--muted-foreground));
}

.task-card .card-footer i {
    margin-right: 0.25rem;
}

.task-card.running {
    border-left: 4px solid rgb(var(--warning));
    background-color: rgb(var(--warning) / 0.05);
}

.task-card.running::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 8px;
    height: 8px;
    background-color: rgb(var(--warning));
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.task-card {
    position: relative;
}

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

.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgb(var(--foreground));
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    background-color: rgb(var(--secondary));
    color: rgb(var(--secondary-foreground));
}

.card-tag.department {
    background-color: rgb(var(--primary) / 0.1);
    color: rgb(var(--primary));
}

.card-tag.supervisor {
    background-color: rgb(var(--info) / 0.1);
    color: rgb(var(--info));
}

.card-footer {
    display: flex;
    justify-content: between;
    align-items: center;
    font-size: 0.8rem;
    color: rgb(var(--muted-foreground));
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(var(--border));
}

.card-created-by {
    flex: 1;
}

.card-time {
    font-size: 0.75rem;
}


.empty-column {
    text-align: center;
    padding: 2rem 1rem;
    color: rgb(var(--muted-foreground));
    font-style: italic;
}

.spinner-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 16px;
    height: 16px;
    border: 2px solid rgb(var(--muted));
    border-top: 2px solid rgb(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =================================== */
/* TASK DETAIL MODAL STYLES */
/* =================================== */

.task-detail-modal .modal-dialog {
    max-width: 900px;
    max-height: 90vh;
    display: flex;
}

.task-detail-modal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-detail-modal .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 200px); /* Account for header and padding */
    flex: 1 1 auto;
}

#taskModalBody {
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Scrollbar styling for modal */
.task-detail-modal .modal-body::-webkit-scrollbar,
#taskModalBody::-webkit-scrollbar {
    width: 8px;
}

.task-detail-modal .modal-body::-webkit-scrollbar-track,
#taskModalBody::-webkit-scrollbar-track {
    background: rgb(var(--muted) / 0.1);
    border-radius: 4px;
}

.task-detail-modal .modal-body::-webkit-scrollbar-thumb,
#taskModalBody::-webkit-scrollbar-thumb {
    background: rgb(var(--muted-foreground) / 0.3);
    border-radius: 4px;
}

.task-detail-modal .modal-body::-webkit-scrollbar-thumb:hover,
#taskModalBody::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--muted-foreground) / 0.5);
}

.modal-header-content {
    width: 100%;
}

.modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    width: 100%;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgb(var(--foreground));
    margin: 0;
}

.task-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(var(--border));
}

.task-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.task-status-badge.pending {
    background-color: rgb(var(--muted));
    color: rgb(var(--muted-foreground));
}

.task-status-badge.in_progress,
.task-status-badge.started {
    background-color: rgb(var(--warning) / 0.1);
    color: rgb(var(--warning));
}

.task-status-badge.completed,
.task-status-badge.success {
    background-color: rgb(var(--success) / 0.1);
    color: rgb(var(--success));
}

.task-status-badge.failed,
.task-status-badge.failure {
    background-color: rgb(var(--destructive) / 0.1);
    color: rgb(var(--destructive));
}


.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    color: rgb(var(--foreground));
}

.task-content-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgb(var(--foreground));
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-content {
    background-color: rgb(var(--muted) / 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgb(var(--border));
}

.requirements-list,
.phases-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirements-list li,
.phases-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgb(var(--border));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirements-list li:last-child,
.phases-list li:last-child {
    border-bottom: none;
}

.requirements-list li::before {
    content: "✓";
    color: rgb(var(--success));
    font-weight: 600;
}

.phases-list li::before {
    content: "▸";
    color: rgb(var(--primary));
    font-weight: 600;
}

.cost-tracking {
    background-color: rgb(var(--card));
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgb(var(--border));
    margin-top: 1rem;
}

.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.cost-item {
    text-align: center;
    padding: 0.75rem;
    background-color: rgb(var(--muted) / 0.3);
    border-radius: 0.375rem;
}

.cost-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgb(var(--primary));
}

.cost-label {
    font-size: 0.8rem;
    color: rgb(var(--muted-foreground));
    margin-top: 0.25rem;
}

/* =================================== */
/* REQUEST LOGS STYLES */
/* =================================== */

.logs-container {
    background-color: rgb(var(--card));
    border-radius: 0.75rem;
    border: 1px solid rgb(var(--border));
    overflow: hidden;
}

.logs-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgb(var(--border));
    background-color: rgb(var(--muted) / 0.3);
}

.logs-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.logs-table-container {
    overflow-x: auto;
    max-height: 70vh;
}

.logs-table {
    width: 100%;
    margin-bottom: 0;
}

.logs-table th {
    position: sticky;
    top: 0;
    background-color: rgb(var(--muted));
    color: rgb(var(--foreground));
    font-weight: 600;
    padding: 0.75rem;
    border-bottom: 2px solid rgb(var(--border));
    white-space: nowrap;
}

.logs-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgb(var(--border) / 0.5);
    vertical-align: middle;
}

.logs-table tr:hover {
    background-color: rgb(var(--accent) / 0.5);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background-color: rgb(var(--success) / 0.1);
    color: rgb(var(--success));
}

.status-badge.error {
    background-color: rgb(var(--destructive) / 0.1);
    color: rgb(var(--destructive));
}

.status-badge.timeout {
    background-color: rgb(var(--warning) / 0.1);
    color: rgb(var(--warning));
}

.response-time {
    font-family: monospace;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgb(var(--primary));
    color: rgb(var(--primary-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* =================================== */
/* RESPONSIVE STYLES */
/* =================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .trello-board {
        flex-direction: column;
    }
    
    .trello-column {
        flex: none;
        max-height: 400px;
    }
    
    .task-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .logs-filters {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* =================================== */
/* JOB CARDS STYLES */
/* =================================== */

.jobs-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
    width: 100%;
    min-height: 100px; /* Ensure some height even when empty */
}

/* Fallback for browsers that don't support grid */
@supports not (display: grid) {
    .jobs-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .job-card {
        flex: 0 0 350px;
        margin: 0 1.25rem 1.25rem 0;
    }
}

/* Ensure jobs view is properly displayed */
.jobs-view {
    width: 100%;
    display: block;
}

/* Default view states - allow JavaScript to override */
.jobs-view#jobsCardView {
    display: block;
}

.jobs-view#jobsTableView {
    display: none;
}

.job-card {
    background-color: rgb(var(--card));
    color: rgb(var(--card-foreground));
    border: 1px solid rgb(var(--border));
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.job-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.job-card.paused {
    opacity: 0.7;
    background-color: rgb(var(--muted));
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.job-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: rgb(var(--foreground));
}

.job-description {
    color: rgb(var(--muted-foreground));
    font-size: 14px;
    margin-bottom: 15px;
}

.job-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

/* Ensure Bootstrap badges work properly in job cards */
.job-card .badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.job-card .badge.bg-primary {
    color: #fff;
    background-color: #0d6efd !important;
}

.job-card .badge.bg-secondary {
    color: #fff;
    background-color: #6c757d !important;
}

.job-card .badge.bg-success {
    color: #fff;
    background-color: #198754 !important;
}

.job-card .badge.bg-info {
    color: #000;
    background-color: #0dcaf0 !important;
}

.job-card .badge.bg-warning {
    color: #000;
    background-color: #ffc107 !important;
}

.job-card .badge.bg-danger {
    color: #fff;
    background-color: #dc3545 !important;
}

.job-type-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    color: rgb(var(--muted-foreground));
}

.job-schedule {
    background-color: rgb(var(--muted));
    color: rgb(var(--foreground));
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 13px;
}

.job-stats {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid rgb(var(--border));
    border-bottom: 1px solid rgb(var(--border));
    margin-bottom: 15px;
}

.job-stats .stat-item {
    text-align: center;
}

.job-stats .stat-item .value {
    font-weight: bold;
    font-size: 16px;
    color: rgb(var(--foreground));
}

.job-stats .stat-item .label {
    font-size: 11px;
    color: rgb(var(--muted-foreground));
    text-transform: uppercase;
}

.job-actions {
    display: flex;
    gap: 10px;
}

.job-actions .btn {
    flex: 1;
}

/* Ensure Bootstrap buttons work properly in job cards */
.job-card .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    line-height: 1.5;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.job-card .btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.job-card .btn-success:hover {
    color: #fff;
    background-color: #157347;
    border-color: #146c43;
}

.job-card .btn-outline-primary {
    color: #0d6efd;
    background-color: transparent;
    border-color: #0d6efd;
}

.job-card .btn-outline-primary:hover {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.job-card .btn-outline-warning {
    color: #ffc107;
    background-color: transparent;
    border-color: #ffc107;
}

.job-card .btn-outline-warning:hover {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

.job-card .btn-outline-info {
    color: #0dcaf0;
    background-color: transparent;
    border-color: #0dcaf0;
}

.job-card .btn-outline-info:hover {
    color: #000;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

/* Job modal configurations */
.type-config {
    background-color: rgb(var(--muted));
    color: rgb(var(--foreground));
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.schedule-config {
    background-color: rgb(var(--muted));
    color: rgb(var(--foreground));
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Empty state styling */
.empty-state {
    background-color: rgb(var(--card));
    color: rgb(var(--card-foreground));
    border: 1px solid rgb(var(--border));
    border-radius: 8px;
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.empty-state .fa-3x {
    color: rgb(var(--muted-foreground));
}

.empty-state h5 {
    color: rgb(var(--foreground));
    margin-bottom: 1rem;
}

.empty-state .text-muted {
    color: rgb(var(--muted-foreground)) !important;
}

/* Mobile responsive job cards */
@media (max-width: 768px) {
    .jobs-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 0 0.5rem;
        margin-top: 1rem;
    }
    
    .job-card {
        min-width: 0;
        width: 100%;
    }
    
    .jobs-page {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .jobs-grid {
        gap: 0.75rem;
        padding: 0;
    }
    
    .job-card {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .jobs-page {
        padding: 0.5rem;
    }
}

/* =================================== */
/* WEBSOCKET NOTIFICATIONS */
/* =================================== */

/* Notification Container (Updated) */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

/* Notification Styles (Updated) */
.notification {
    pointer-events: auto;
    background: rgb(var(--card));
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 0;
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: rgb(var(--muted) / 0.5);
    border-bottom: 1px solid rgb(var(--border));
}

.notification-header strong {
    font-size: 0.9rem;
    color: rgb(var(--foreground));
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: rgb(var(--muted-foreground));
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: rgb(var(--foreground));
}

.notification-body {
    padding: 12px 15px;
    color: rgb(var(--foreground));
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Notification Types with left border */
.notification-info {
    border-left: 4px solid rgb(var(--info));
}

.notification-success {
    border-left: 4px solid rgb(var(--success));
}

.notification-warning {
    border-left: 4px solid rgb(var(--warning));
}

.notification-error {
    border-left: 4px solid rgb(var(--destructive));
}

/* Notification animation */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* WebSocket Connection Status */
.ws-connection-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.ws-connection-indicator.connected {
    background-color: rgb(var(--success));
    box-shadow: 0 0 0 2px rgb(var(--success) / 0.3);
}

.ws-connection-indicator.disconnected {
    background-color: rgb(var(--destructive));
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* MCP Router Status Indicator in UI */
.mcp-router-status {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.mcp-router-status.running {
    background-color: rgb(var(--success) / 0.1);
    border: 1px solid rgb(var(--success) / 0.3);
    color: rgb(var(--success));
}

.mcp-router-status.stopped {
    background-color: rgb(var(--destructive) / 0.1);
    border: 1px solid rgb(var(--destructive) / 0.3);
    color: rgb(var(--destructive));
}

.proxy-status-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.proxy-failure-count {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 10px;
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
    .notification-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        margin-bottom: 8px;
    }
    
    @keyframes slideIn {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* =================================== */
/* UPLOAD AREA STYLES */
/* =================================== */

/* Upload area (drag & drop zone) */
.upload-area,
.drop-zone {
    border: 2px dashed rgb(var(--border));
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    background: rgb(var(--card));
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover,
.drop-zone:hover,
.drop-zone.dragover {
    border-color: rgb(var(--primary));
    background: rgb(var(--primary) / 0.05);
}

/* Dark mode specific styles for upload area */
[data-theme="dark"] .upload-area,
[data-theme="dark"] .drop-zone {
    background: rgb(var(--card));
    border-color: rgb(var(--border));
}

[data-theme="dark"] .upload-area:hover,
[data-theme="dark"] .upload-area.dragover,
[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .drop-zone.dragover {
    background: rgb(var(--primary) / 0.1);
    border-color: rgb(var(--primary));
}

/* Auto theme detection for upload area */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .upload-area,
    :root:not([data-theme]) .drop-zone {
        background: rgb(var(--card));
        border-color: rgb(var(--border));
    }
    
    :root:not([data-theme]) .upload-area:hover,
    :root:not([data-theme]) .upload-area.dragover,
    :root:not([data-theme]) .drop-zone:hover,
    :root:not([data-theme]) .drop-zone.dragover {
        background: rgb(var(--primary) / 0.1);
        border-color: rgb(var(--primary));
    }
}

/* =================================== */
/* ADDITIONAL COMPONENTS */
/* =================================== */

/* Logs statistics */
.logs-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background-color: rgb(var(--muted) / 0.3);
    border-radius: 0.5rem;
    border: 1px solid rgb(var(--border));
    min-width: 80px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(var(--foreground));
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: rgb(var(--muted-foreground));
    text-align: center;
    margin-top: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Additional task card animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card.new-task {
    animation: fadeIn 0.5s ease-out;
}

/* Dark mode sidebar adjustments */
[data-theme="dark"] .sidebar {
    background-color: rgb(var(--card));
    border-right-color: rgb(var(--border));
}

[data-theme="dark"] .top-bar {
    background-color: rgb(var(--card));
    border-bottom-color: rgb(var(--border));
}

/* =================================== */
/* ENHANCED PHASE DISPLAY STYLES */
/* =================================== */

.phases-wrapper {
    margin-top: 1rem;
}

.phase-item {
    background-color: rgb(var(--muted) / 0.2);
    border: 1px solid rgb(var(--border));
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: rgb(var(--muted) / 0.3);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.phase-header:hover {
    background-color: rgb(var(--muted) / 0.5);
}

.phase-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    font-weight: 600;
    color: rgb(var(--foreground));
}

.phase-chevron {
    transition: transform 0.2s ease;
    color: rgb(var(--muted-foreground));
}

.phase-chevron.fa-chevron-down {
    transform: rotate(0deg);
}

.phase-chevron.fa-chevron-right {
    transform: rotate(-90deg);
}

.phase-progress {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar-wrapper {
    width: 150px;
    height: 8px;
    background-color: rgb(var(--border));
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: rgb(var(--primary));
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: rgb(var(--muted-foreground));
    min-width: 60px;
    text-align: right;
}

.phase-content {
    padding: 1rem;
    border-top: 1px solid rgb(var(--border));
    background-color: rgb(var(--card));
}

.subtasks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subtask-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.subtask-item:hover {
    background-color: rgb(var(--accent) / 0.1);
}

.subtask-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: rgb(var(--primary));
    cursor: pointer;
}

.subtask-text {
    flex: 1;
    color: rgb(var(--foreground));
    line-height: 1.5;
}

.subtask-item.completed .subtask-text {
    text-decoration: line-through;
    color: rgb(var(--muted-foreground));
    opacity: 0.7;
}

/* Dark mode phase styles */
[data-theme="dark"] .phase-item {
    background-color: rgb(var(--card));
    border-color: rgb(var(--border));
}

[data-theme="dark"] .phase-header {
    background-color: rgb(var(--muted) / 0.2);
}

[data-theme="dark"] .phase-header:hover {
    background-color: rgb(var(--muted) / 0.4);
}

[data-theme="dark"] .phase-content {
    background-color: rgb(var(--background));
}

[data-theme="dark"] .subtask-item:hover {
    background-color: rgb(var(--accent) / 0.2);
}

/* Phase status indicators */
.phase-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.phase-status.complete {
    background-color: rgb(var(--success) / 0.1);
    color: rgb(var(--success));
}

.phase-status.in-progress {
    background-color: rgb(var(--warning) / 0.1);
    color: rgb(var(--warning));
}

.phase-status.pending {
    background-color: rgb(var(--muted) / 0.3);
    color: rgb(var(--muted-foreground));
}