/* ============================================
   FEATURES.CSS - Checklist, Completion Modal, Calendar, Toasts
   ============================================
   Contains:
   - Calendar overrides
   - Date range filter
   - Completed releases
   - Sub-tab navigation
   - Toast notifications
   - Incomplete items warning
   - PR-first release view
   - Release completion modal
   - Release checklist styles
   - Calendar search
   ============================================ */

/* ============================================
   CALENDAR OVERRIDES
   ============================================ */

/* Calendar View Whitespace Fix - Modular Override */
.tab-pane#calendar {
    padding-top: 0 !important;
}
.tab-pane#calendar h2 {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}
/* Remove all vertical whitespace above calendar */
.tab-content, .tab-pane#calendar, #calendar-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    min-height: 0 !important;
}
#calendar-container, #calendar-container > .fc {
    margin-top: 0 !important;
    padding-top: 0 !important;
    min-height: 0 !important;
}
/* Remove margin from FullCalendar root and children */
#calendar-container .fc {
    margin-top: 0 !important;
    min-height: 0 !important;
}
#calendar-container .fc-view {
    margin-top: 0 !important;
    min-height: 0 !important;
}

/* Calendar Event Styles */
.calendar-release .fc-event-title {
    font-weight: bold;
}
.calendar-pr .fc-event-title {
    font-style: italic;
}
.fc-event.calendar-release {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}
.fc-event.calendar-pr {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: #ffffff !important;
}
/* Ensure all text inside events is white */
.fc-event.calendar-release .fc-event-title,
.fc-event.calendar-release .fc-event-time,
.fc-event.calendar-pr .fc-event-title,
.fc-event.calendar-pr .fc-event-time {
    color: #ffffff !important;
}

/* Dark mode FullCalendar */
[data-theme="dark"] .fc-daygrid-event .fc-event-time,
[data-theme="dark"] .fc-daygrid-event .fc-event-title {
  color: #fff !important;
}

[data-theme="dark"] .fc-list-item .fc-list-item-title {
  color: #fff !important;
}

/* ============================================
   COMPLETED RELEASES STYLES
   ============================================ */

/* Date Range Filter */
.date-range-filter {
    background: var(--surface);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
}

.date-range-filter input[type="date"] {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.875rem;
}

.date-range-filter input[type="date"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

[data-theme="dark"] .date-range-filter input[type="date"] {
    background: var(--surface);
    border-color: var(--border);
}

/* Completed release badge styling */
.badge-completed {
    background: var(--success-soft);
    color: var(--success-text);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Calendar event styling for completed releases */
.fc-event.calendar-release-completed {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    opacity: 0.85;
}

.fc-event.calendar-release-completed:hover {
    opacity: 1;
}

/* Completed releases table styling */
#completedReleasesList .badge.bg-success {
    font-size: 0.75rem;
}

#completedReleasesList small.text-muted {
    font-size: 0.7rem;
}

/* ============================================
   SECONDARY NAVIGATION - Underline Tab Style
   ============================================ */
.secondary-nav-container {
    display: flex;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-soft);
    width: 100%;
    margin-bottom: 0;
}

.secondary-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.secondary-nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.secondary-nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom-color: var(--primary);
}

.secondary-nav-link.active:hover {
    background: var(--primary-light);
}

.secondary-nav-link i {
    font-size: 1rem;
}

/* Sub-tab content visibility */
.subtab-content {
    display: block;
    width: 100%;
    padding-top: 20px;
}

.subtab-content.hidden {
    display: none;
}

/* First section header shell in subtab content doesn't need extra top margin */
.subtab-content > .section-header-shell:first-child {
    margin-top: 0;
}

/* Dark mode adjustments for secondary nav */
[data-theme="dark"] .secondary-nav-container {
    border-bottom-color: var(--border);
}

[data-theme="dark"] .secondary-nav-link:hover {
    background: var(--primary-soft);
}

/* Ensure tables in subtabs take full width */
.subtab-content .table-responsive-wrapper {
    width: 100%;
}

.subtab-content .table {
    width: 100%;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    min-width: 320px;
    max-width: 450px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    animation: toastSlideIn 0.3s ease-out;
    background: var(--surface);
    border-left: 4px solid;
    pointer-events: auto;
}

.toast-notification.toast-success {
    border-left-color: var(--success);
}

.toast-notification.toast-error {
    border-left-color: var(--danger);
}

.toast-notification.toast-warning {
    border-left-color: var(--warning);
}

.toast-notification.toast-info {
    border-left-color: var(--primary);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-notification.toast-hiding {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Dark mode toast adjustments */
[data-theme="dark"] .toast-notification {
    background: var(--surface-elevated);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   INCOMPLETE ITEMS WARNING STYLES
   ============================================ */

/* Warning badge for incomplete items count */
.incomplete-warning-badge {
    cursor: pointer;
    font-size: 0.75rem;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.incomplete-warning-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.incomplete-warning-badge:active {
    transform: scale(0.95);
}

/* Incomplete work item row styling in expanded view */
/* Override Bootstrap's table-warning to use red for incomplete items (both modes) */
.table-warning {
    --bs-table-bg: #fef2f2;
    --bs-table-color: #7f1d1d;
    --bs-table-border-color: #fecaca;
    --bs-table-striped-bg: #fee2e2;
    --bs-table-striped-color: #7f1d1d;
    --bs-table-hover-bg: #fecaca;
    --bs-table-hover-color: #7f1d1d;
}

.table .table-warning,
.table-warning > td,
.table-warning > th {
    background-color: #fef2f2 !important;
    color: #7f1d1d !important;
}

.table-warning td a,
.table-warning a {
    color: #991b1b !important;
}

.table-warning td a:hover,
.table-warning a:hover {
    color: #7f1d1d !important;
    text-decoration: underline;
}

/* Dark mode: Darker red background with white text */
[data-theme="dark"] .table-warning {
    --bs-table-bg: #7f1d1d;
    --bs-table-color: #ffffff;
    --bs-table-border-color: #991b1b;
    --bs-table-striped-bg: #7f1d1d;
    --bs-table-striped-color: #ffffff;
    --bs-table-hover-bg: #991b1b;
    --bs-table-hover-color: #ffffff;
}

[data-theme="dark"] .table .table-warning,
[data-theme="dark"] .table-warning > td,
[data-theme="dark"] .table-warning > th {
    background-color: #7f1d1d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .table-warning td a,
[data-theme="dark"] .table-warning a {
    color: #ffffff !important;
    text-decoration: underline;
}

[data-theme="dark"] .table-warning td a:hover,
[data-theme="dark"] .table-warning a:hover {
    color: #fecaca !important;
}

[data-theme="dark"] .table-warning td .badge,
[data-theme="dark"] .table-warning .badge {
    color: #ffffff !important;
    background-color: #991b1b !important;
}

/* Warning icon in state column */
.table td .bi-exclamation-triangle-fill.text-warning {
    font-size: 0.875rem;
    cursor: help;
}

/* ============================================
   PR-FIRST RELEASE VIEW STYLES
   ============================================ */

/* PR expand button */
.pr-expand-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}

.pr-expand-btn i {
    transition: transform 0.2s ease;
}

/* Nested work items row */
.pr-workitems-row td {
    border-top: none !important;
}

.pr-workitems-container {
    max-height: 300px;
    overflow-y: auto;
}

/* Unlinked work items section */
.border-top {
    border-color: var(--border) !important;
}

/* Section headers in expanded release views */
.release-workitems-container h6.text-muted,
.pr-workitems-container h6.text-muted {
    color: var(--text-secondary) !important;
}

.release-workitems-container small.text-muted {
    color: var(--text-muted) !important;
}

/* Nested work items row background */
.pr-workitems-row td {
    background: var(--surface-hover) !important;
}

/* Tables in expanded views */
.release-workitems-container .table,
.pr-workitems-container .table {
    background: var(--surface);
    color: var(--text-primary);
}

.release-workitems-container .table th,
.pr-workitems-container .table th {
    color: var(--text-secondary);
    border-color: var(--border);
}

.release-workitems-container .table td,
.pr-workitems-container .table td {
    border-color: var(--border);
}

/* Striped rows in dark mode */
[data-theme="dark"] .release-workitems-container .table-striped > tbody > tr:nth-of-type(odd),
[data-theme="dark"] .pr-workitems-container .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Button links in tables */
.release-workitems-container .btn-outline-secondary,
.pr-workitems-container .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}

.release-workitems-container .btn-outline-secondary:hover,
.pr-workitems-container .btn-outline-secondary:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Empty state messages */
.empty-message {
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   RELEASE COMPLETION MODAL
   ============================================ */

.release-completion-modal {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow-lg);
}

/* Header States */
.release-completion-modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: none;
    transition: background 0.3s ease;
}

.release-completion-modal .modal-header.header-loading {
    background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
    color: white;
}

.release-completion-modal .modal-header.header-ready {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.release-completion-modal .modal-header.header-incomplete {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
}

.release-completion-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.release-completion-modal .modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon-badge {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.release-completion-modal .modal-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Loading State */
.completion-loading-shell {
    padding: 3rem 1rem;
}

.completion-loading-shell .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Ready State */
.ready-message {
    text-align: center;
    padding: 2rem 1rem;
}

.ready-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.ready-icon i {
    font-size: 2.5rem;
    color: #16a34a;
}

.ready-message h5 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ready-message p {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
}

.ready-warning {
    background: var(--warning-soft);
    color: var(--warning-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

/* Incomplete State */
.incomplete-summary {
    background: #fef2f2;
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    border-left: 4px solid #dc2626;
}

.incomplete-summary i {
    font-size: 1.25rem;
    color: #dc2626;
}

.incomplete-section {
    margin-bottom: 1.5rem;
}

.incomplete-section:last-child {
    margin-bottom: 0;
}

.completion-detail-section {
    background: transparent;
    border: none;
    padding: 0;
}

.completion-detail-section .detail-section-shell__header {
    margin-bottom: 0.75rem;
}

.completion-detail-section .detail-section-shell__title h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.completion-detail-section .detail-section-shell__title h6 i {
    color: var(--danger);
}

.incomplete-table-wrapper {
    max-height: 200px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.incomplete-table-wrapper .table {
    margin: 0;
}

.incomplete-table-wrapper .table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-elevated);
    border-bottom: 2px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    padding: 0.625rem 0.75rem;
}

.incomplete-table-wrapper .table tbody td {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    vertical-align: middle;
}

.incomplete-table-wrapper .table tbody tr:hover {
    background: var(--surface-hover);
}

/* Footer */
.release-completion-modal .modal-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
}

.release-completion-modal .btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: none;
    font-weight: 600;
}

.release-completion-modal .btn-success:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-1px);
}

.release-completion-modal .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
    border: none;
}

.release-completion-modal .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
}

/* Dark mode adjustments */
[data-theme="dark"] .release-completion-modal {
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .ready-icon {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.2) 0%, rgba(21, 128, 61, 0.3) 100%);
}

[data-theme="dark"] .ready-icon i {
    color: #4ade80;
}

[data-theme="dark"] .ready-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

[data-theme="dark"] .incomplete-summary {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-left-color: #ef4444;
}

[data-theme="dark"] .incomplete-summary i {
    color: #f87171;
}

[data-theme="dark"] .incomplete-table-wrapper {
    border-color: var(--border);
}

[data-theme="dark"] .incomplete-table-wrapper .table thead th {
    background: var(--surface-elevated);
}

[data-theme="dark"] .release-completion-modal .modal-footer {
    background: var(--surface-elevated);
}

/* ===== RELEASE CHECKLIST STYLES ===== */

.checklist-section.detail-section-shell {
    background: transparent;
    border: none;
    padding: 0;
}

.checklist-section .detail-section-shell__header {
    margin-bottom: 1rem;
    padding-bottom: 0;
    border-bottom: none;
}

/* Checklist Section Headers */
.checklist-section .detail-section-shell__title h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.checklist-section .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Checklist List Items */
.checklist-section .list-group-item {
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.checklist-section .list-group-item:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

/* PR Checklist Item Styling */
.checklist-section .list-group-item .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
    cursor: pointer;
}

.checklist-section .list-group-item .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* PR Sub-items (nested checklist) */
.pr-subitems {
    border-color: var(--border) !important;
    padding-left: 1.5rem;
}

.pr-subitems .form-check {
    margin-bottom: 0;
}

.pr-subitems .form-check-label {
    font-size: 0.875rem;
}

/* Trigger checkboxes (Has DB Changes, User-Facing) */
.form-check-inline {
    margin-right: 1rem;
}

.form-check-inline .form-check-label {
    color: var(--text-secondary);
}

.form-check-inline .form-check-input:checked + .form-check-label {
    color: var(--primary);
}

/* Checklist progress badge in tab */
#checklistProgressBadge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Uninitialized checklist state */
#checklistContainer .text-center {
    padding: 2rem;
}

#checklistContainer .text-center i.bi-clipboard-plus {
    opacity: 0.8;
}

/* Strikethrough styling for completed items */
.text-decoration-line-through {
    text-decoration: line-through;
}

/* Completion modal checklist section */
#completionChecklistSection .detail-section-shell {
    background: var(--surface-hover);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

#completionChecklistSection .detail-section-shell__title h6 {
    color: var(--text-primary);
}

#completionChecklistSection .detail-section-shell__body .table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

#completionChecklistSection .detail-section-shell__body .table td {
    vertical-align: middle;
    padding: 0.5rem;
}

/* Dark mode overrides */
[data-theme="dark"] .checklist-section .list-group-item {
    background: var(--surface-elevated);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .checklist-section .list-group-item:hover {
    background: var(--surface-hover);
}

[data-theme="dark"] .checklist-section .list-group-item strong {
    color: var(--text-primary);
}

[data-theme="dark"] .checklist-section .list-group-item span {
    color: var(--text-primary);
}

[data-theme="dark"] .checklist-section .list-group-item .form-check-label {
    color: var(--text-primary);
}

[data-theme="dark"] .checklist-section .list-group-item .form-check-label.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .checklist-section .list-group-item small.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .checklist-section h6 {
    color: var(--text-primary);
}

[data-theme="dark"] .checklist-section p.text-muted {
    color: var(--text-secondary) !important;
}

/* Work Items Section Styling */
.work-items-section .list-group-item.work-item-entry {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.work-items-section .work-item-title {
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.work-items-section .work-item-title span {
    color: var(--text-primary);
}

.work-items-section .work-item-action {
    padding-left: 1.5rem;
}

[data-theme="dark"] .work-items-section .list-group-item {
    background: var(--surface-elevated);
    border-color: var(--border);
}

[data-theme="dark"] .work-items-section .work-item-title,
[data-theme="dark"] .work-items-section .work-item-title span {
    color: var(--text-primary);
}

[data-theme="dark"] .work-items-section .btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .work-items-section .btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .pr-subitems {
    border-color: var(--border) !important;
}

[data-theme="dark"] .pr-subitems .form-check-label {
    color: var(--text-primary);
}

[data-theme="dark"] .pr-subitems .form-check-label.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .form-check-inline .form-check-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .form-check-inline .form-check-input:checked + .form-check-label {
    color: var(--primary);
}

[data-theme="dark"] #completionChecklistSection .detail-section-shell {
    background: var(--surface-elevated);
}

[data-theme="dark"] #completionChecklistSection .detail-section-shell__body .table {
    color: var(--text-primary);
}

/* Checklist button in release row */
.checklist-btn {
    transition: all var(--transition-base);
}

.checklist-btn.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
    background: transparent;
}

.checklist-btn.btn-outline-secondary:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.checklist-btn.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--warning-text);
}

.checklist-btn.btn-warning:hover {
    background: var(--warning-hover, #e6a800);
    border-color: var(--warning-hover, #e6a800);
}

.checklist-btn.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: var(--success-text);
}

.checklist-btn.btn-success:hover {
    background: var(--success-hover, #0d8a4a);
    border-color: var(--success-hover, #0d8a4a);
}

.checklist-btn.btn-success i {
    animation: checkPulse 0.3s ease;
}

@keyframes checkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Standalone checklist modal */
#checklistStandaloneModal .modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
}

#checklistStandaloneModal .modal-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

#checklistStandaloneModal .modal-title {
    color: var(--text-primary);
}

#checklistStandaloneModal .modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#checklistStandaloneModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    background: var(--surface);
}

#checklistStandaloneModal .modal-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
}

#checklistStandaloneContainer .checklist-section {
    margin-bottom: 1.5rem;
}

#checklistStandaloneContainer .checklist-section:last-child {
    margin-bottom: 0;
}

/* Dark mode overrides for checklist button */
[data-theme="dark"] .checklist-btn.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .checklist-btn.btn-outline-secondary:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

[data-theme="dark"] .checklist-btn.btn-warning {
    color: #000;
}

[data-theme="dark"] .checklist-btn.btn-success {
    color: #fff;
}

/* Dark mode overrides for standalone modal */
[data-theme="dark"] #checklistStandaloneModal .modal-content {
    background: var(--surface-elevated);
    border-color: var(--border);
}

[data-theme="dark"] #checklistStandaloneModal .modal-header {
    background: var(--surface-elevated);
    border-bottom-color: var(--border);
}

[data-theme="dark"] #checklistStandaloneModal .modal-body {
    background: var(--surface-elevated);
}

[data-theme="dark"] #checklistStandaloneModal .modal-footer {
    background: var(--surface-elevated);
    border-top-color: var(--border);
}

[data-theme="dark"] #checklistStandaloneModal .btn-secondary {
    background: var(--surface-hover);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneModal .btn-secondary:hover {
    background: var(--surface);
    border-color: var(--border-hover);
}

[data-theme="dark"] #checklistStandaloneModal .modal-title {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneModal .modal-subtitle {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #checklistStandaloneContainer {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer .list-group-item {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer .list-group-item:hover {
    background: var(--surface-hover);
}

[data-theme="dark"] #checklistStandaloneContainer .list-group-item strong {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer .list-group-item span {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer .form-check-label {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer .form-check-label.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #checklistStandaloneContainer small.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #checklistStandaloneContainer h6 {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer p.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #checklistStandaloneContainer .pr-subitems {
    border-color: var(--border) !important;
}

[data-theme="dark"] #checklistStandaloneContainer .pr-subitems .form-check-label {
    color: var(--text-primary);
}

[data-theme="dark"] #checklistStandaloneContainer .pr-subitems .form-check-label.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #checklistStandaloneContainer .form-check-inline .form-check-label {
    color: var(--text-secondary);
}

[data-theme="dark"] #checklistStandaloneContainer .badge {
    color: #fff;
}

/* ============================================
   CALENDAR SEARCH
   ============================================ */

.calendar-search-surface__result-icon.release {
    background: rgba(0, 120, 212, 0.1);
    color: var(--primary);
}

.calendar-search-surface__result-icon.release-completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.calendar-search-surface__result-icon.workitem {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.calendar-search-surface__result-icon.pr {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.calendar-search-highlight {
    background: rgba(245, 158, 11, 0.25);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* Calendar event highlight animation */
.fc-event.calendar-event-highlight {
    animation: calendarEventHighlight 2s ease-out;
    box-shadow: 0 0 0 3px var(--warning), 0 0 12px var(--warning) !important;
}

@keyframes calendarEventHighlight {
    0% {
        box-shadow: 0 0 0 3px var(--warning), 0 0 20px var(--warning) !important;
    }
    100% {
        box-shadow: none !important;
    }
}

[data-theme="dark"] .calendar-search-highlight {
    background: rgba(245, 158, 11, 0.35);
}
