/* Unified Ticket Dashboard Styles v1.5.0 */
body {
  background: #f4f4f4;
}

/* Common Styles */
.status-alert {
    margin-top: 1rem;
}

.hidden {
    display: none;
}

.wrapper {
  max-width: 1200px;
  margin: auto;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
@media (max-width: 767px) {
	.section-head {
		flex-direction: column;
	}   
}

/* Sliding animation for instructions */
#instructions {
    overflow: hidden;
	display: none;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
}

#instructions.show {
    /*overflow-y: auto;*/
    /*max-height: 80vh; /* fallback */
    /*max-height: 80dvh; /* modern browsers */
	display: block;
	height: 100%;
	max-height: 2000px;
	opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.4s ease-in;
}

/* Tab Styling */
.nav-tabs .nav-link.active {
	background-color: #fff;
	border-color: #dee2e6 #dee2e6 #fff;
  }

/* ============================================================
   CLOSED TICKETS TAB STYLES
   ============================================================ */
.dashboard-table {
    margin-top: .6rem;
    table-layout: fixed; /* Equal width columns */
}

.dashboard-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.dashboard-table td,
.dashboard-table th {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Allow dashboard table to scroll properly on mobile */
.table-responsive .dashboard-table {
    table-layout: auto;
    min-width: 600px;
}

/* Sticky first column */
.dashboard-table th:first-child,
.dashboard-table td:first-child {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 1;
}

.dashboard-table thead th:first-child {
    background-color: #f8f9fa;
    z-index: 2;
}

.dashboard-table .target-row td:first-child {
    background-color: #f0f0f0;
}

.dashboard-table .total-row td:first-child {
    background-color: #333;
}

.target-row td {
    background-color: #f0f0f0;
    font-weight: 600;
}

.total-row td {
    background-color: #333;
    color: white;
    font-weight: 700;
    border-color: #999;
}

.target-input {
    width: 100px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    text-align: left;
}

/* Charts - side by side */
.chart-container {
    position: relative;
    height: 400px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* ============================================================
   CURRENT WORKLOAD TAB STYLES
   ============================================================ */
.priority-card {
    text-align: center;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.priority-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.priority-card .card-text {
    font-weight: 700;
    margin-bottom: 0;
}

.high-priority {
    border-left: 5px solid #dc3545;
    background-color: #f8d7da;
}

.high-priority .card-text {
    color: #dc3545;
}

.medium-priority {
    border-left: 5px solid #ffc107;
    background-color: #fff3cd;
}

.medium-priority .card-text {
    color: #856404;
}

.low-priority {
    border-left: 5px solid #28a745;
    background-color: #d4edda;
}

.low-priority .card-text {
    color: #28a745;
}

.workload-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.workload-table {
    table-layout: fixed; /* Equal width columns */
}

.workload-table td,
.workload-table th {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Allow workload table to scroll properly on mobile */
.table-responsive .workload-table {
    table-layout: auto;
    min-width: 600px;
}

/* Sticky first column */
.workload-table th:first-child,
.workload-table td:first-child {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 1;
}

.workload-table thead th:first-child {
    background-color: #f8f9fa;
    z-index: 2;
}

.workload-table .total-row td:first-child {
    background-color: #333;
}

/* Emphasize the Open Tickets column */
.workload-table th:nth-child(2),
.workload-table td:nth-child(2) {
    background-color: #e7f1ff;
    font-weight: 700;
    font-size: 1.05em;
}

.workload-table th:nth-child(2) {
    background-color: #d0e7ff;
}
.workload-table .total-row td:nth-child(2) {
    background-color: #000;
}

.ticket-list-table {
    font-size: 0.9rem;
    table-layout: auto; /* Auto width columns based on content */
}

.ticket-list-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ticket-list-table th.sortable {
    padding: 0;
}

.ticket-list-table th.sortable:hover {
    background-color: #e9ecef;
}

/* Sortable headers are real buttons so they work with a keyboard and screen reader. */
.ticket-list-table .sort-button {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ticket-list-table .sort-button:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: -3px;
}

.ticket-list-table .sort-button::after {
    content: ' ⇅';
    opacity: 0.5;
    font-size: 0.8em;
}

.ticket-list-table th[aria-sort="ascending"] .sort-button::after {
    content: ' ▲';
    opacity: 0.9;
}

.ticket-list-table th[aria-sort="descending"] .sort-button::after {
    content: ' ▼';
    opacity: 0.9;
}

.ticket-list-table td {
    vertical-align: middle;
}

/* Sticky first column in ticket table */
.ticket-list-table th:first-child,
.ticket-list-table td:first-child {
	font-weight: 700;
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 5;
}

.ticket-list-table thead th:first-child {
    background-color: #f8f9fa;
    z-index: 11;
}

/* Striped rows - ensure first column has solid background */
/*.ticket-list-table tbody tr:nth-of-type(odd) td:first-child {
    background-color: #e0e0e0;
}

.ticket-list-table tbody tr:nth-of-type(even) td:first-child {
    background-color: #fff;
}*/

.ticket-list-table tbody tr:nth-of-type(odd) td {
    background-color: #f0f0f0;
}

.ticket-list-table tbody tr:nth-of-type(even) td {
    background-color: #fff;
}

/* Shadow on sticky columns when scrolled */
.table-responsive.scrolled .dashboard-table th:first-child,
.table-responsive.scrolled .dashboard-table td:first-child,
.table-responsive.scrolled .workload-table th:first-child,
.table-responsive.scrolled .workload-table td:first-child,
.table-responsive.scrolled .ticket-list-table th:first-child,
.table-responsive.scrolled .ticket-list-table td:first-child {
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.priority-high {
    background-color: #dc3545;
    color: white;
}

.badge.priority-medium {
    background-color: #ffc107;
    color: #000;
}

.badge.priority-low {
    background-color: #28a745;
    color: white;
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
}

/* Responsive wrapper margins for mobile */
@media (max-width: 1199px) {
    .wrapper {
        margin: auto 20px;
    }
}

/* Print Styles */
@media print {
    .navbar-toggler,
    #overlayMenu,
    .btn,
    #fileInput,
    .nav-tabs,
    #instructions {
        display: none !important;
    }
    
    .tab-content > .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }
}

/* ============================================================
   WORK ANALYSIS TAB STYLES
   ============================================================ */
.analysis-card {
    text-align: center;
    border-left: 5px solid #0d6efd;
    background-color: #f8f9fa;
    margin-bottom: 1rem;
}

.analysis-card .card-title {
    font-size: 1rem;
    font-weight: 600;
}

.analysis-card .card-text {
    font-weight: 700;
    margin-bottom: 0;
}

.work-type-chart {
    min-height: 500px;
}

/* The expanded detail table needs more horizontal room on small screens. */
.table-responsive .ticket-list-table {
    min-width: 1050px;
}

/* v3.0.0 team-only work analysis */
.team-analysis-note { background: #e8f3fb; border-left: 4px solid #3684b9; padding: .85rem 1rem; border-radius: .25rem; }

/* v3.0.2 — Work Analysis narrative and lifecycle */
.analysis-summary-panel { background: #e8f3fb; border: 1px solid #c7e0f3; border-radius: 6px; padding: 1.15rem 1.3rem; color: #183b54; }
.analysis-summary-panel h4, .analysis-lifecycle h4 { font-size: 1.2rem; margin-bottom: .65rem; }
.analysis-missing { border: 1px solid #dee2e6; border-radius: 6px; padding: .85rem 1rem; }
.analysis-missing summary { cursor: pointer; font-weight: 600; }
.analysis-missing .table { font-size: .9rem; }
.analysis-lifecycle { margin-top: 1.5rem; }
.analysis-lifecycle .chart-container { min-height: 290px; }
.analysis-lifecycle .card-title { font-size: 1rem; }
@media (max-width: 576px) { .analysis-summary-panel { padding: 1rem; } }

/* Hide the categorization accordion entirely when all tickets are categorized. */
.analysis-missing[hidden] { display: none !important; }

/* v3.0.8 — readability and consistent visual rhythm */
.analysis-summary-panel { padding: 20px; }
.analysis-summary-panel h4 { font-size: 18px; line-height: 1.35; margin-bottom: 10px; }
.analysis-summary-panel p { font-size: 15px; line-height: 1.6; }
.analysis-insights { margin-bottom: 28px !important; }
.analysis-missing { margin-top: 16px !important; }
.analysis-lifecycle { margin-top: 28px; margin-bottom: 32px !important; }
.analysis-lifecycle h4 { font-size: 20px; line-height: 1.35; margin-bottom: 12px; }
.analysis-lifecycle .row { margin-top: 16px; margin-bottom: 16px !important; }
.analysis-lifecycle .chart-container { margin-bottom: 16px; }
#csvDataTimestamp { font-size: 13px; line-height: 1.5; }
#workAnalysisContainer .section-head { margin-bottom: 12px; }
#workAnalysisContainer .section-head h3 { margin-bottom: 0; }
#workAnalysisContainer .section-head p { display: none; }
#workAnalysisContainer .work-analysis-intro { font-size: 15px; line-height: 1.5; margin-bottom: 16px; }
#workAnalysisContainer .row.gap-3 { row-gap: 24px !important; }
/* JS sets explicit height for both horizontal charts from their category count. */
#workAnalysisContainer .work-type-chart { min-height: 260px; }
@media (max-width: 576px) { .analysis-summary-panel { padding: 16px; } }

/* v3.1.0 — pace columns and cumulative chart */
.pace-note { font-size: 13px; line-height: 1.5; margin-top: -0.5rem; margin-bottom: 1.5rem; max-width: 70rem; }
.dashboard-table td:nth-child(n+3), .dashboard-table th:nth-child(n+3) { white-space: nowrap; }

/* v3.1.3 — larger summary panels */
.analysis-summary-panel { padding: 24px 28px; }
.analysis-summary-panel h4 { font-size: 22px; line-height: 1.3; margin-bottom: 12px; }
.analysis-summary-panel p { font-size: 18px; line-height: 1.6; }
@media (max-width: 576px) {
    .analysis-summary-panel { padding: 18px; }
    .analysis-summary-panel h4 { font-size: 20px; }
    .analysis-summary-panel p { font-size: 16px; }
}

/* v3.1.5 — Work Analysis cards */
.analysis-card .card-subtext { font-size: 14px; color: #555; margin: 0.25rem 0 0; }
.analysis-card .card-text-name { font-size: 1.6rem; font-weight: 700; line-height: 1.25; margin: 0.35rem 0 0; }
#workAnalysisContainer .chart-container.effort-chart { height: 340px; }
