/* Custom Styles for Task Management Dashboard */

/* Global styles for proper height handling and scroll containment */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Root app container should handle all scrolling */
#__next {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Prevent auto-scroll conflicts with positioned elements */
*[style*="position: fixed"],
*[style*="position: sticky"],
.fixed,
.sticky {
    /* Add containment for better scroll performance */
    contain: layout style;
    transition: none !important;
}

/* Ensure overlay elements don't interfere with auto-scroll */
[class*="overlay"],
[class*="jsx-"] {
    /* Improve scroll containment */
    contain: layout style;
}

.container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    /* Remove height constraints to let main-content handle sizing */
    height: 100%;
    overflow: hidden;
}

/* Navigation height consideration */
.navbar {
    height: 75px; /* Standard Bootstrap navbar height */
    flex-shrink: 0; /* Don't shrink in flexbox layout */
    overflow: hidden; /* Prevent navbar from adding scroll */
}

/* Main content area with proper scroll */
.main-content {
    flex: 1;
    height: calc(100vh - 75px);
    padding: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tab Content - Let content scroll properly */
.tab-content {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-pane.active {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Gantt tab specific - no scroll, let table-container handle it */
#gantt {
    /* Remove fixed height */
    height: 100%;
    overflow: hidden; /* No scroll - let table-container handle it */
    contain: layout style;
    display: flex;
    flex-direction: column;
}

/* Table Container - ONLY scrollable area */
.table-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

.table-container table {
    margin-bottom: 0;
}

.table-container thead th {
    /* Remove sticky positioning to prevent auto-scroll conflicts */
    position: relative;
    top: 0;
    background: #212529;
    z-index: 10;
    border-top: none;
}

/* Gantt Chart direct wrapper styles */
.gantt-wrapper {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    position: relative;
    /* Remove overflow auto to prevent double scroll - let main-content handle it */
    overflow: visible;
    contain: layout style; /* Improve layout performance and prevent scroll conflicts */
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* Ensure Gantt library components size naturally */
.gantt-wrapper > div {
    width: 100% !important;
    min-height: fit-content; /* Let content determine height */
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* Fix scroll area sizing */
.gantt-wrapper [class*="_gantt-container"] {
    overflow: visible !important;
    height: auto !important;
}

/* Ensure proper scrolling behavior */
.gantt-wrapper [class*="_gantt-"] {
    overflow: visible !important;
}

.gantt-wrapper [class*="_task-list"] {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.gantt-wrapper [class*="_gantt-chart"] {
    overflow: auto !important;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Filter section spacing */
.filter-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* Gantt Chart Styles - Fixed scrolling issues */
.gantt-container {
    position: relative;
    width: 100%;
    /* Remove fixed height - let content determine height */
    min-height: auto;
    /* Remove fixed height and overflow properties */
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    /* Add scroll containment */
    contain: layout style;
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

.gantt-header {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    /* Replace sticky with relative positioning */
    position: relative;
    top: 0;
    z-index: 15;
    min-width: max-content; /* Allow header to extend beyond viewport */
}

.gantt-header .gantt-label {
    font-weight: bold;
    background-color: #e9ecef;
    /* Replace sticky with relative positioning */
    position: relative;
    left: 0;
    z-index: 20;
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #dee2e6;
}

.gantt-header-timeline {
    position: relative;
    flex: 1;
    background-color: #f8f9fa;
    min-height: 60px;
    /* Width will be set dynamically by JavaScript */
}

.gantt-timeline {
    position: relative;
    min-height: 400px;
    min-width: max-content; /* Ensure timeline extends beyond viewport */
    /* Width will be set dynamically by JavaScript */
}

.gantt-row {
    position: relative;
    min-height: 60px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    min-width: max-content; /* Ensure rows extend to full timeline width */
}

.gantt-row:hover {
    background-color: #f8f9fa;
}

.gantt-label {
    /* Replace sticky with relative positioning for better auto-scroll compatibility */
    position: relative;
    left: 0;
    width: 250px;
    min-width: 250px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-right: 2px solid #dee2e6;
    font-size: 0.875rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 60px;
    flex-shrink: 0;
    line-height: 1.2;
}

.gantt-bar {
    position: absolute;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
}

.gantt-bar:hover {
    transform: none !important;
    box-shadow: var(--WAKANDI-shadow-md);
}

.gantt-bar-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: none !important;
}

.gantt-date-label {
    position: absolute;
    top: 8px;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    text-align: center;
    padding: 8px 4px;
    border-right: 1px solid #e9ecef;
    /* Positioning handled by left/width */
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dc3545;
    z-index: 4;
}

.gantt-weekend {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.05);
    z-index: 1;
}

/* Navigation and UI Styles */
.navbar-brand {
    font-weight: bold;
}

.task-row:hover {
    background-color: #f8f9fa;
}

.progress-bar {
    min-width: 2em;
    transition: none !important;
}

.project-badge {
    font-size: 0.8em;
    padding: 0.25em 0.5em;
}

/* Remove all conflicting tab display rules - let Bootstrap handle it */

/* Assignee header styling for assignee view */
.gantt-assignee-header {
    background-color: #f8f9fa !important;
    border-top: 2px solid #dee2e6 !important;
    font-weight: 600 !important;
}

.gantt-assignee-header .gantt-label {
    background-color: #e9ecef !important;
    font-weight: bold !important;
}

/* WAK Status Dashboard - WAKANDI Brand Styles */

/* CSS Variables for WAKANDI Brand Colors */
:root {
    /* Primary Brand Colors */
    --WAKANDI-teal: #00A693;
    --WAKANDI-teal-dark: #008A7A;
    --WAKANDI-teal-light: #1AB5A6;
    --WAKANDI-teal-lighter: #E0F7F4;
    
    /* Secondary Colors */
    --WAKANDI-yellow: #F4C430;
    --WAKANDI-orange: #F47068;
    --WAKANDI-red: #E74C3C;
    --WAKANDI-blue: #3498DB;
    --WAKANDI-purple: #9B59B6;
    
    /* Neutral Colors */
    --WAKANDI-neutral-900: #2C3E50;
    --WAKANDI-neutral-800: #34495E;
    --WAKANDI-neutral-700: #5D6D7E;
    --WAKANDI-neutral-600: #85929E;
    --WAKANDI-neutral-500: #AEB6BF;
    --WAKANDI-neutral-400: #D5DBDB;
    --WAKANDI-neutral-300: #EAEDED;
    --WAKANDI-neutral-200: #F4F6F6;
    --WAKANDI-neutral-100: #FAFBFC;
    --WAKANDI-white: #FFFFFF;
    
    /* Gradients */
    --WAKANDI-gradient-primary: linear-gradient(135deg, var(--WAKANDI-teal) 0%, var(--WAKANDI-teal-dark) 100%);
    --WAKANDI-gradient-secondary: linear-gradient(135deg, var(--WAKANDI-yellow) 0%, var(--WAKANDI-orange) 100%);
    
    /* Typography */
    --WAKANDI-font-primary: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --WAKANDI-font-secondary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --WAKANDI-spacing-xs: 0.25rem;
    --WAKANDI-spacing-sm: 0.5rem;
    --WAKANDI-spacing-md: 1rem;
    --WAKANDI-spacing-lg: 1.5rem;
    --WAKANDI-spacing-xl: 2rem;
    --WAKANDI-spacing-xxl: 3rem;
    
    /* Border Radius */
    --WAKANDI-radius-sm: 4px;
    --WAKANDI-radius-md: 8px;
    --WAKANDI-radius-lg: 12px;
    --WAKANDI-radius-xl: 16px;
    
    /* Shadows */
    --WAKANDI-shadow-sm: 0 2px 4px rgba(0, 166, 147, 0.08);
    --WAKANDI-shadow-md: 0 4px 12px rgba(0, 166, 147, 0.12);
    --WAKANDI-shadow-lg: 0 8px 24px rgba(0, 166, 147, 0.16);
    --WAKANDI-shadow-xl: 0 16px 48px rgba(0, 166, 147, 0.20);
}

/* Typography Import */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--WAKANDI-font-secondary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--WAKANDI-neutral-800);
    background-color: var(--WAKANDI-neutral-100);
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
    line-height: 1.4;
    color: var(--WAKANDI-neutral-900);
    margin-bottom: var(--WAKANDI-spacing-md);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

.display-6 {
    font-family: var(--WAKANDI-font-primary);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--WAKANDI-neutral-900);
}

/* Navigation */
.navbar {
    background: var(--WAKANDI-gradient-primary) !important;
    padding: var(--WAKANDI-spacing-md) 0;
    box-shadow: var(--WAKANDI-shadow-md);
}

.navbar-brand {
    font-family: var(--WAKANDI-font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--WAKANDI-white) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--WAKANDI-teal-lighter) !important;
}

.navbar-nav .nav-link {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
    color: var(--WAKANDI-white) !important;
    padding: var(--WAKANDI-spacing-sm) var(--WAKANDI-spacing-md);
    border-radius: var(--WAKANDI-radius-md);
    transition: all 0.3s ease;
    margin-right: var(--WAKANDI-spacing-sm);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--WAKANDI-white) !important;
}

.navbar-text {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
}

/* Buttons */
.btn {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
    border-radius: var(--WAKANDI-radius-md);
    padding: var(--WAKANDI-spacing-sm) var(--WAKANDI-spacing-lg);
    border: none;
    transition: all 0.3s ease;
    box-shadow: var(--WAKANDI-shadow-sm);
}

.btn-primary {
    background: var(--WAKANDI-gradient-primary);
    color: var(--WAKANDI-white);
}

.btn-primary:hover {
    background: var(--WAKANDI-teal-dark);
    transform: translateY(-2px);
    box-shadow: var(--WAKANDI-shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--WAKANDI-teal);
    color: var(--WAKANDI-teal);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--WAKANDI-teal);
    color: var(--WAKANDI-white);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: var(--WAKANDI-white);
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--WAKANDI-white);
    color: var(--WAKANDI-teal);
    border-color: var(--WAKANDI-white);
}

.btn-success {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    color: var(--WAKANDI-white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--WAKANDI-yellow), var(--WAKANDI-orange));
    color: var(--WAKANDI-white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--WAKANDI-red), #C0392B);
    color: var(--WAKANDI-white);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--WAKANDI-neutral-600), var(--WAKANDI-neutral-700));
    color: var(--WAKANDI-white);
}

.btn-lg {
    padding: var(--WAKANDI-spacing-md) var(--WAKANDI-spacing-xl);
    font-size: 1.125rem;
    border-radius: var(--WAKANDI-radius-lg);
}

.btn-sm {
    padding: var(--WAKANDI-spacing-xs) var(--WAKANDI-spacing-md);
    font-size: 0.875rem;
    border-radius: var(--WAKANDI-radius-sm);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--WAKANDI-radius-lg);
    box-shadow: var(--WAKANDI-shadow-md);
    background: var(--WAKANDI-white);
    transition: all 0.3s ease;
    overflow: hidden;
    /* Make cards flex containers */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    box-shadow: var(--WAKANDI-shadow-lg);
}

.card-header {
    background: var(--WAKANDI-neutral-100);
    border-bottom: 1px solid var(--WAKANDI-neutral-300);
    padding: var(--WAKANDI-spacing-lg);
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
    color: var(--WAKANDI-neutral-900);
    /* Don't shrink header */
    flex-shrink: 0;
}

.card-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Special handling for card-body with p-0 class (like in Gantt) */
.card-body.p-0 {
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
    color: var(--WAKANDI-neutral-900);
    margin-bottom: var(--WAKANDI-spacing-md);
}

/* Statistics Cards */
.stat-card {
    background: var(--WAKANDI-white);
    border-radius: var(--WAKANDI-radius-lg);
    box-shadow: var(--WAKANDI-shadow-md);
    padding: var(--WAKANDI-spacing-lg);
    text-align: center;
    transition: all 0.3s ease;
    border-left: 4px solid var(--WAKANDI-teal);
}

.stat-card:hover {
    box-shadow: var(--WAKANDI-shadow-lg);
}

.stat-value {
    font-family: var(--WAKANDI-font-primary);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--WAKANDI-teal);
    margin-bottom: var(--WAKANDI-spacing-xs);
    line-height: 1;
}

.stat-label {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
    color: var(--WAKANDI-neutral-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--WAKANDI-radius-lg);
    background: var(--WAKANDI-teal-lighter);
    color: var(--WAKANDI-teal);
    font-size: 1.5rem;
    margin: 0 auto var(--WAKANDI-spacing-md);
}

/* Tables */
.table {
    background: var(--WAKANDI-white);
    border-radius: var(--WAKANDI-radius-lg);
    overflow: hidden;
    box-shadow: var(--WAKANDI-shadow-sm);
}

.table thead th {
    background: var(--WAKANDI-teal);
    color: var(--WAKANDI-white);
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
    border: none;
    padding: var(--WAKANDI-spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.table tbody td {
    padding: var(--WAKANDI-spacing-md);
    border-bottom: 1px solid var(--WAKANDI-neutral-300);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--WAKANDI-teal-lighter);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
    padding: var(--WAKANDI-spacing-xs) var(--WAKANDI-spacing-sm);
    border-radius: var(--WAKANDI-radius-md);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-success {
    background: linear-gradient(135deg, #27AE60, #2ECC71) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--WAKANDI-yellow), var(--WAKANDI-orange)) !important;
    color: var(--WAKANDI-white) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--WAKANDI-red), #C0392B) !important;
}

.badge.bg-primary {
    background: var(--WAKANDI-gradient-primary) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, var(--WAKANDI-neutral-600), var(--WAKANDI-neutral-700)) !important;
}

.project-badge {
    font-weight: 600;
    padding: var(--WAKANDI-spacing-sm) var(--WAKANDI-spacing-md);
    border-radius: var(--WAKANDI-radius-lg);
}

/* Progress Bars */
.progress {
    height: 24px;
    background-color: var(--WAKANDI-neutral-300);
    border-radius: var(--WAKANDI-radius-lg);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: var(--WAKANDI-gradient-primary);
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 24px;
    transition: none !important;
}

.progress-bar.bg-success {
    background: linear-gradient(135deg, #27AE60, #2ECC71) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(135deg, var(--WAKANDI-yellow), var(--WAKANDI-orange)) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(135deg, var(--WAKANDI-red), #C0392B) !important;
}

/* Forms */
.form-control {
    border: 2px solid var(--WAKANDI-neutral-400);
    border-radius: var(--WAKANDI-radius-md);
    padding: var(--WAKANDI-spacing-sm) var(--WAKANDI-spacing-md);
    font-family: var(--WAKANDI-font-secondary);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--WAKANDI-teal);
    box-shadow: 0 0 0 3px rgba(0, 166, 147, 0.1);
}

.form-label {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
    color: var(--WAKANDI-neutral-800);
    margin-bottom: var(--WAKANDI-spacing-xs);
}

.form-select {
    border: none;
    transition: all 0.3s ease;
    box-shadow: var(--WAKANDI-shadow-sm);
    padding: vr(--WAKANDI-spacing-sm)a 30px;
    width: auto !important;
    min-width: fit-content !important;
    max-width: none !important;
    color: var(--WAKANDI-neutral-700);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-select:focus {
    border-color: var(--WAKANDI-teal);
    box-shadow: 0 0 0 3px rgba(0, 166, 147, 0.1);
    outline: 0;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--WAKANDI-radius-xl);
    box-shadow: var(--WAKANDI-shadow-xl);
}

.modal-header {
    background: var(--WAKANDI-gradient-primary);
    color: var(--WAKANDI-white);
    border-bottom: none;
    border-radius: var(--WAKANDI-radius-xl) var(--WAKANDI-radius-xl) 0 0;
    padding: var(--WAKANDI-spacing-lg);
}

.modal-title {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 600;
}

.modal-body {
    padding: var(--WAKANDI-spacing-xl);
}

.modal-footer {
    border-top: 1px solid var(--WAKANDI-neutral-300);
    padding: var(--WAKANDI-spacing-lg) var(--WAKANDI-spacing-xl);
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--WAKANDI-neutral-300);
    margin-bottom: var(--WAKANDI-spacing-lg);
}

.nav-tabs .nav-link {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
    color: var(--WAKANDI-neutral-700);
    border: none;
    border-radius: var(--WAKANDI-radius-md) var(--WAKANDI-radius-md) 0 0;
    padding: var(--WAKANDI-spacing-md) var(--WAKANDI-spacing-lg);
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--WAKANDI-teal);
    background-color: var(--WAKANDI-teal-lighter);
}

.nav-tabs .nav-link.active {
    color: var(--WAKANDI-teal);
    background-color: var(--WAKANDI-white);
    border-bottom: 2px solid var(--WAKANDI-teal);
    font-weight: 600;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--WAKANDI-radius-lg);
    padding: var(--WAKANDI-spacing-md) var(--WAKANDI-spacing-lg);
    font-family: var(--WAKANDI-font-secondary);
    box-shadow: var(--WAKANDI-shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.1));
    color: #1e7e34;
    border-left: 4px solid #27AE60;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(244, 196, 48, 0.1), rgba(244, 112, 104, 0.1));
    color: #856404;
    border-left: 4px solid var(--WAKANDI-yellow);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
    color: #721c24;
    border-left: 4px solid var(--WAKANDI-red);
}

.alert-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
    color: #0c5460;
    border-left: 4px solid var(--WAKANDI-blue);
}

/* Dropdown */
.dropdown-menu {
    border: none;
    border-radius: var(--WAKANDI-radius-lg);
    box-shadow: var(--WAKANDI-shadow-lg);
    padding: var(--WAKANDI-spacing-sm);
}

.dropdown-item {
    font-family: var(--WAKANDI-font-secondary);
    padding: var(--WAKANDI-spacing-sm) var(--WAKANDI-spacing-md);
    border-radius: var(--WAKANDI-radius-md);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--WAKANDI-teal-lighter);
    color: var(--WAKANDI-teal);
}

/* Welcome Screen */
.min-vh-100 {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--WAKANDI-teal-lighter) 0%, var(--WAKANDI-neutral-100) 100%);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--WAKANDI-gradient-primary);
    border-radius: var(--WAKANDI-radius-xl);
    color: var(--WAKANDI-white);
    font-size: 2.5rem;
}

/* Gantt Chart Styles */
.gantt-container {
    background: var(--WAKANDI-white);
    border-radius: var(--WAKANDI-radius-lg);
    box-shadow: var(--WAKANDI-shadow-md);
    overflow: hidden;
}

/* Filter Controls */
.filter-controls {
    background: var(--WAKANDI-white);
    border-radius: var(--WAKANDI-radius-lg);
    box-shadow: var(--WAKANDI-shadow-sm);
    padding: var(--WAKANDI-spacing-lg);
    margin-bottom: var(--WAKANDI-spacing-lg);
}

/* Main Content */
.main-content {
    padding-top: var(--WAKANDI-spacing-lg);
}

.container-fluid {
    padding: 0 var(--WAKANDI-spacing-lg);
    /* Remove height constraints */
    height: 100%;
    overflow: hidden;
}

/* Utility Classes */
.text-WAKANDI-teal {
    color: var(--WAKANDI-teal) !important;
}

.bg-WAKANDI-teal {
    background-color: var(--WAKANDI-teal) !important;
}

.border-WAKANDI-teal {
    border-color: var(--WAKANDI-teal) !important;
}

.text-muted {
    color: var(--WAKANDI-neutral-600) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 var(--WAKANDI-spacing-md);
    }
    
    .main-content {
        padding-top: var(--WAKANDI-spacing-md);
    }
    
    .card-body {
        padding: var(--WAKANDI-spacing-md);
    }
    
    .display-6 {
        font-size: 1.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

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

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

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

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

/* Loading States */
.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--WAKANDI-teal-lighter);
    border-top: 3px solid var(--WAKANDI-teal);
    border-radius: 50%;
    animation: none !important;
}

/* ===== ROADMAP STYLES ===== */

/* Roadmap Container */
.roadmap-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Improve scroll containment and prevent auto-scroll conflicts */
    contain: layout style;
    overflow: visible;
}

/* Roadmap Header */
.roadmap-header {
    /* Replace sticky with relative positioning */
    position: relative;
    top: 0;
    z-index: 20;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    height: 80px;
    min-width: max-content; /* Allow header to extend beyond viewport */
}

.roadmap-projects-header {
    /* Replace sticky with relative positioning */
    position: relative;
    left: 0;
    z-index: 25;
    width: 300px;
    min-width: 300px;
    background: #e9ecef;
    border-right: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: #495057;
    flex-shrink: 0;
}

.roadmap-timeline-header {
    position: relative;
    flex: 1;
    background: #f8f9fa;
    /* Remove separate scrolling - let parent container handle it */
    overflow: visible;
    /* Width will be set dynamically by JavaScript */
    min-width: 100%;
}

.roadmap-content {
    position: relative;
    /* Remove separate scrolling - let parent container handle it */
    overflow: visible;
    /* Width will be set dynamically by JavaScript */
    min-width: max-content;
}

/* Remove separate scrollbar styles for header and content */
.roadmap-timeline-header::-webkit-scrollbar,
.roadmap-content::-webkit-scrollbar {
    display: none;
}

.roadmap-project-timeline {
    position: relative;
    flex: 1;
    min-height: 60px;
    /* Width will be set dynamically by JavaScript */
    background: linear-gradient(90deg, transparent 0%, transparent calc(100% - 1px), #e9ecef calc(100% - 1px));
    background-size: 50px 100%; /* Default grid size, will be adjusted by view mode */
}

/* View-specific timeline widths */
.roadmap-timeline-header[data-view="weekly"] {
    min-width: 2600px; /* Enough space for 52 weeks */
}

.roadmap-timeline-header[data-view="quarterly"] {
    min-width: 1200px; /* Enough space for 4 quarters */
}

.roadmap-timeline-header[data-view="yearly"] {
    min-width: 900px; /* Enough space for 3 years */
}

.roadmap-timeline-header[data-view="monthly"] {
    min-width: 1800px; /* Enough space for 12 months */
}

/* Project timeline full width */
.roadmap-project-timeline {
    position: relative;
    height: 70px;
    width: 100%;
    min-width: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent 0%,
        transparent 24.5%,
        rgba(0, 166, 147, 0.1) 25%,
        rgba(0, 166, 147, 0.1) 25.5%,
        transparent 26%
    );
    padding: var(--WAKANDI-spacing-md) 0;
}

.timeline-period {
    padding: var(--WAKANDI-spacing-md);
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-family: var(--WAKANDI-font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timeline period view-specific styles */
.timeline-period[data-view="weekly"] {
    min-width: 50px;
    font-size: 0.8rem;
}

.timeline-period[data-view="quarterly"] {
    min-width: 300px;
    font-size: 1.1rem;
}

.timeline-period[data-view="yearly"] {
    min-width: 300px;
    font-size: 1.2rem;
}

.timeline-period[data-view="monthly"] {
    min-width: 150px;
    font-size: 1rem;
}

/* Weekly view specific styles */
.timeline-period[data-day="0"],
.timeline-period[data-day="6"] {
    background: rgba(0, 0, 0, 0.1);
}

.timeline-period .day-name {
    font-size: 1rem;
    margin-bottom: 4px;
}

.timeline-period .day-date {
    font-size: 0.8rem;
    opacity: 0.9;
}

.timeline-period:last-child {
    border-right: none;
}

/* Current period highlight */
.timeline-period.current {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 700;
    position: relative;
}

.timeline-period.current::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--WAKANDI-yellow);
}

/* Roadmap Content */
.roadmap-content {
    min-height: 400px;
    background: var(--WAKANDI-white);
    min-width: max-content;
    width: 100%;
}

.roadmap-project-row {
    position: relative;
    min-height: 70px;
    border-bottom: 1px solid var(--WAKANDI-neutral-200);
    background: var(--WAKANDI-white);
    transition: background-color 0.2s ease;
}

.roadmap-project-row:hover {
    background: var(--WAKANDI-neutral-50);
}

.roadmap-project-row:last-child {
    border-bottom: none;
}

.roadmap-project-row::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 166, 147, 0.1), transparent);
    transition: left 0.5s;
}

.roadmap-project-row:hover::before {
    left: 100%;
}

.roadmap-project-info {
    width: 280px;
    min-width: 280px;
    padding: var(--WAKANDI-spacing-lg) var(--WAKANDI-spacing-xl);
    border-right: 1px solid var(--WAKANDI-neutral-300);
    background: var(--WAKANDI-white);
    /* Replace sticky with relative positioning to prevent auto-scroll conflicts */
    position: relative;
    left: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}

.roadmap-project-row:hover .roadmap-project-info {
    background: var(--WAKANDI-teal-lighter);
}

.project-name {
    font-family: var(--WAKANDI-font-primary);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--WAKANDI-neutral-900);
    margin-bottom: var(--WAKANDI-spacing-xs);
    line-height: 1.3;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: var(--WAKANDI-spacing-md);
    margin-top: var(--WAKANDI-spacing-sm);
}

.project-status {
    padding: var(--WAKANDI-spacing-xs) var(--WAKANDI-spacing-md);
    border-radius: var(--WAKANDI-radius-lg);
    font-family: var(--WAKANDI-font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--WAKANDI-shadow-sm);
}

.project-status.active {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    color: var(--WAKANDI-white);
}

.project-status.planning {
    background: var(--WAKANDI-gradient-primary);
    color: var(--WAKANDI-white);
}

.project-status.completed {
    background: linear-gradient(135deg, var(--WAKANDI-neutral-600), var(--WAKANDI-neutral-700));
    color: var(--WAKANDI-white);
}

.project-status.delayed {
    background: linear-gradient(135deg, var(--WAKANDI-red), #C0392B);
    color: var(--WAKANDI-white);
}

.project-team {
    font-family: var(--WAKANDI-font-secondary);
    font-size: 0.75rem;
    color: var(--WAKANDI-neutral-600);
    display: flex;
    align-items: center;
    gap: var(--WAKANDI-spacing-xs);
    font-weight: 500;
}

/* Roadmap Bars */
.roadmap-bar {
    position: absolute;
    height: 50px;
    background: linear-gradient(135deg, var(--WAKANDI-teal) 0%, var(--WAKANDI-teal-dark) 100%);
    color: white;
    border-radius: var(--WAKANDI-radius-md);
    cursor: pointer;
    transition: none !important;
    box-shadow: var(--WAKANDI-shadow-sm);
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4px 8px;
    line-height: 1.2;
    font-size: 0.75rem;
    min-width: 120px;
}

.roadmap-bar:hover {
    transform: none !important;
    box-shadow: var(--WAKANDI-shadow-md);
    background: linear-gradient(135deg, var(--WAKANDI-teal-dark) 0%, var(--WAKANDI-teal) 100%);
}

.roadmap-bar.milestone {
    background: var(--WAKANDI-gradient-secondary);
    height: 36px;
    border-radius: var(--WAKANDI-radius-lg);
    font-weight: 700;
    box-shadow: var(--WAKANDI-shadow-lg);
}

.roadmap-bar.feature {
    background: var(--WAKANDI-gradient-primary);
    height: 28px;
}

.roadmap-bar.epic {
    background: linear-gradient(135deg, var(--WAKANDI-purple), #8E44AD);
    height: 40px;
    border-radius: var(--WAKANDI-radius-lg);
    font-weight: 700;
}

.roadmap-bar.task {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    height: 24px;
}

.roadmap-bar.research {
    background: linear-gradient(135deg, var(--WAKANDI-orange), #E67E22);
    height: 28px;
}

.roadmap-bar.new-item {
    animation: slideInRight 0.6s ease;
}

/* Progress Indicators */
.progress-indicator {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--WAKANDI-radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--WAKANDI-radius-sm);
    transition: none !important;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* Timeline Today Marker */
.today-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--WAKANDI-red);
    z-index: 50;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
    border-radius: var(--WAKANDI-radius-sm);
}

.today-marker::before {
    content: 'Today';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--WAKANDI-red);
    color: var(--WAKANDI-white);
    padding: var(--WAKANDI-spacing-xs) var(--WAKANDI-spacing-sm);
    border-radius: var(--WAKANDI-radius-md);
    font-family: var(--WAKANDI-font-primary);
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--WAKANDI-shadow-md);
}

/* Priority Indicators */
.priority-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.priority-high {
    background: var(--WAKANDI-red);
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
}

.priority-medium {
    background: var(--WAKANDI-yellow);
    box-shadow: 0 0 6px rgba(244, 196, 48, 0.5);
}

.priority-low {
    background: #27AE60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.5);
}

/* Roadmap Loading and Empty States */
.roadmap-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    color: var(--WAKANDI-neutral-600);
    font-family: var(--WAKANDI-font-primary);
    font-weight: 500;
}

.roadmap-loading .loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--WAKANDI-teal-lighter);
    border-top: 4px solid var(--WAKANDI-teal);
    border-radius: 50%;
    animation: none !important;
    margin-right: var(--WAKANDI-spacing-md);
}

.roadmap-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 300px;
    color: var(--WAKANDI-neutral-600);
    text-align: center;
    font-family: var(--WAKANDI-font-primary);
}

.roadmap-empty i {
    font-size: 4rem;
    margin-bottom: var(--WAKANDI-spacing-lg);
    color: var(--WAKANDI-teal-lighter);
}

.roadmap-empty h5 {
    color: var(--WAKANDI-neutral-700);
    font-weight: 600;
    margin-bottom: var(--WAKANDI-spacing-sm);
}

.roadmap-empty p {
    color: var(--WAKANDI-neutral-600);
    font-size: 0.9rem;
}

/* Filter Badge */
.filter-badge {
    position: absolute;
    top: var(--WAKANDI-spacing-lg);
    right: var(--WAKANDI-spacing-lg);
    background: var(--WAKANDI-gradient-primary);
    color: var(--WAKANDI-white);
    padding: var(--WAKANDI-spacing-xs) var(--WAKANDI-spacing-md);
    border-radius: var(--WAKANDI-radius-lg);
    font-family: var(--WAKANDI-font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--WAKANDI-shadow-md);
}

/* Roadmap Tooltips */
.roadmap-tooltip {
    position: absolute;
    background: var(--WAKANDI-neutral-900);
    color: var(--WAKANDI-white);
    padding: var(--WAKANDI-spacing-sm) var(--WAKANDI-spacing-md);
    border-radius: var(--WAKANDI-radius-md);
    font-family: var(--WAKANDI-font-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: none !important;
    max-width: 250px;
    line-height: 1.4;
    box-shadow: var(--WAKANDI-shadow-lg);
}

.roadmap-tooltip.show {
    opacity: 1;
}

.roadmap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--WAKANDI-neutral-900) transparent transparent transparent;
}

/* Roadmap Scrollbar Customization */
.roadmap-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    display: block !important;
}

.roadmap-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.roadmap-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 3px solid #f1f1f1;
}

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

.roadmap-container::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* Roadmap Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%) translateY(-50%);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(-50%);
        opacity: 1;
    }
}

/* Roadmap Responsive Design */
@media (max-width: 768px) {
    .roadmap-projects-header,
    .roadmap-project-info {
        width: 220px;
        min-width: 220px;
        padding: var(--WAKANDI-spacing-md) var(--WAKANDI-spacing-lg);
    }
    
    .project-timeline {
        min-width: 600px;
    }
    
    .roadmap-bar {
        font-size: 0.6rem;
        height: 28px;
        padding: 0 var(--WAKANDI-spacing-xs);
    }
    
    .roadmap-bar.milestone,
    .roadmap-bar.epic {
        height: 32px;
    }
    
    .project-name {
        font-size: 1rem;
    }
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-controls .dropdown-toggle {
    min-width: 120px;
    text-align: left;
}

.timeline-controls .dropdown-toggle i {
    margin-right: 0.5rem;
}

.timeline-controls .btn {
    border-color: var(--WAKANDI-neutral-300);
    color: var(--WAKANDI-neutral-700);
    transition: none !important;
}

.timeline-controls .btn:hover {
    border-color: var(--WAKANDI-teal);
    color: var(--WAKANDI-teal);
    background-color: var(--WAKANDI-teal-lighter);
}

.timeline-controls .dropdown-menu {
    min-width: 160px;
}

.timeline-controls .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.timeline-controls .dropdown-item i {
    width: 1.2rem;
    text-align: center;
}

.timeline-controls .dropdown-item:hover {
    background-color: var(--WAKANDI-teal-lighter);
    color: var(--WAKANDI-teal);
}

/* Authentication-based layout control */
body.loading #mainContent,
body.loading #mainNavbar {
    display: none !important;
}

body.authenticated #welcomeScreen {
    display: none !important;
}

body.authenticated #mainContent {
    display: block !important;
}

body.authenticated #mainNavbar {
    display: block !important;
}

body:not(.authenticated) #welcomeScreen {
    display: block !important;
}

body:not(.authenticated) #mainContent {
    display: none !important;
}

body:not(.authenticated) #mainNavbar {
    display: none !important;
}

/* Auth-required elements */
body.authenticated .auth-required {
    display: block !important;
}

body:not(.authenticated) .auth-required {
    display: none !important;
}

/* Admin-based layout control */
body.admin .admin-only {
    display: block !important;
}

body:not(.admin) .admin-only {
    display: none !important;
}

body.admin .admin-nav {
    display: block !important;
}

body:not(.admin) .admin-nav {
    display: none !important;
}

/* Admin badge/indicator */
.admin-badge {
    background: linear-gradient(135deg, var(--WAKANDI-orange), var(--WAKANDI-red));
    color: var(--WAKANDI-white);
    padding: var(--WAKANDI-spacing-xs) var(--WAKANDI-spacing-sm);
    border-radius: var(--WAKANDI-radius-md);
    font-family: var(--WAKANDI-font-primary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: var(--WAKANDI-spacing-sm);
    box-shadow: var(--WAKANDI-shadow-sm);
}

/* Ensure proper width calculations for timeline elements */
#ganttTimeline {
    width: 100%;
    min-height: 400px;
    /* Remove overflow constraints */
}

/* Ensure proper sticky behavior in all browsers */
.gantt-header,
.gantt-label {
    /* Remove fixed height constraints to prevent scrolling issues */
    min-height: auto;
}

/* Gantt Chart in Tab/Card Context (Management Page) */
.tab-pane .card-body .gantt-wrapper {
    /* Remove overflow constraints that cause double scrollbars */
    overflow: visible !important;
    width: 100%;
}

/* Ensure Gantt in tabs has proper constraints */
.tab-pane .roadmap-container {
    /* Let content determine height naturally */
    height: auto !important;
    min-height: 500px;
}
