/* Gantt Planning View Styles */

/* Container */
.gantt-planning-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Filter Bar */
.gantt-filter-bar {
    padding: var(--space-md);
    background: var(--theme-bg-secondary);
    border-bottom: 1px solid var(--theme-border-color);
}

.gantt-filter-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    align-items: center;
}

/* Legend */
.gantt-legend {
    display: flex;
    gap: 15px;
    font-size: 12px;
    align-items: center;
    margin-top: var(--space-md);
}

.gantt-legend__item {
    display: flex;
    align-items: center;
}

.gantt-legend__color-box {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 5px;
    border-radius: 2px;
}

.gantt-legend__color-box--initiative {
    background-color: var(--theme-gantt-initiative, #6f42c1);
}

.gantt-legend__color-box--work-package {
    background-color: var(--theme-gantt-workpackage, #0366d6);
}

.gantt-legend__color-box--assignment {
    background-color: var(--theme-gantt-assignment, #2ea44f);
}

/* Split Pane Layout */
.gantt-split {
    display: grid;
    grid-template-columns: 36% 8px 64%;
    grid-template-rows: 1fr;
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.gantt-panel {
    overflow: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.gantt-resizer {
    width: 8px;
    background: var(--theme-border-color);
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    user-select: none;
}

.gantt-resizer:hover {
    background: var(--theme-primary-hover);
}

/* Table Wrapper */
.gantt-table-wrapper {
    overflow: auto;
    height: 100%;
    flex: 1;
    min-height: 0;
}

/* Theme-aware scrollbar */
.gantt-table-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.gantt-table-wrapper::-webkit-scrollbar-track {
    background: var(--theme-bg-secondary);
    border-radius: 5px;
}

.gantt-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--theme-border-color);
    border-radius: 5px;
}

.gantt-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--theme-text-muted);
}

/* Firefox scrollbar */
.gantt-table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-border-color) var(--theme-bg-secondary);
}

/* Table */
.gantt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.gantt-hierarchy {
    table-layout: auto;
}

/* Table Headers */
.gantt-table__header-cell {
    text-align: left;
    padding: 6px;
    border-bottom: 1px solid var(--theme-border-light);
    background: var(--theme-bg-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Base Cell Styles */
.gantt-table__cell {
    padding: 6px;
    border-bottom: 1px solid var(--theme-border-light);
    vertical-align: middle;
}

/* Initiative Row Cells */
.gantt-table__cell--initiative {
    border-bottom-color: var(--theme-border-light);
}

.gantt-table__cell--initiative-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gantt-table__title-container>div:first-child {
    font-weight: 600;
}

.gantt-table__id-badge {
    font-family: monospace;
    color: var(--theme-text-secondary);
    font-size: 12px;
}

/* Work Package Row Cells */
.gantt-table__cell--wp {
    padding: 6px 6px 6px 32px;
    border-bottom: 1px solid var(--theme-border-light);
}

.gantt-table__cell--wp-title {
    padding: 6px 6px 6px 32px;
}

.gantt-table__cell--wp-title>div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}

.gantt-table__cell--wp-title .gantt-expander {
    flex-shrink: 0;
    margin: 0;
}

.gantt-table__cell--wp-teams {
    color: var(--theme-text-secondary);
}

.gantt-table__cell--wp-sde {
    color: var(--theme-text-primary);
}

/* Assignment Row Cells */
.gantt-table__cell--assignment {
    padding: 4px 6px 4px 48px;
    border-bottom: 1px solid var(--theme-border-light);
    color: var(--theme-text-secondary);
    font-size: 13px;
}

.gantt-table__cell--assignment-empty {
    padding: 4px;
    border-bottom: 1px solid var(--theme-border-light);
}

/* Other Teams Toggle Row */
.gantt-table__cell--other-teams {
    padding: 4px 6px 4px 48px;
    border-bottom: 1px solid var(--theme-border-light);
    color: var(--theme-text-secondary);
    font-size: 12px;
}

.gantt-table__cell--other-teams-action {
    padding: 4px;
    border-bottom: 1px solid var(--theme-border-light);
}

/* Empty State */
.gantt-table__empty {
    padding: 10px;
    text-align: center;
    color: var(--theme-text-muted);
}

.gantt-table__empty-wp {
    padding: 6px 12px;
    color: var(--theme-text-muted);
}

/* Expander Button */
.gantt-expander {
    width: 24px;
    height: 24px;
    border: 1px solid var(--theme-border-color);
    background: var(--theme-bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
}

.gantt-expander:hover {
    background: var(--theme-bg-secondary);
    border-color: var(--theme-primary);
}

/* Action Buttons */
.gantt-add-wp {
    padding: 4px 8px;
    font-size: 12px;
}

/* WP Actions Column - buttons inline */
.gantt-table__cell--wp-actions {
    white-space: nowrap;
}

.gantt-table__cell--wp-actions button {
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

/* Row States */
.gantt-init-row {
    background: var(--theme-bg-primary);
}

.gantt-init-row:hover {
    background: var(--theme-bg-secondary);
}

.gantt-wp-row {
    background: var(--theme-bg-tertiary);
}

.gantt-wp-row:hover {
    background: var(--theme-bg-tertiary);
}

.gantt-wp-assign-row {
    background: var(--theme-bg-secondary);
}

.gantt-wp-assign-row:hover {
    background: var(--theme-bg-tertiary);
}

/* Focus States */
.gantt-focus-row {
    background: color-mix(in srgb, var(--theme-warning), transparent 85%) !important;
}

.gantt-focus-initiative {
    border-left: 3px solid var(--theme-primary);
}

/* Chart Container */
.gantt-chart-box {
    padding: var(--space-md);
    background: var(--theme-card-bg);
    min-height: 400px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* Input Fields in Table */
.gantt-table input[type="text"],
.gantt-table input[type="date"],
.gantt-table input[type="number"] {
    padding: 4px 6px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.gantt-table input[disabled] {
    background: var(--theme-bg-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

.gantt-table input[type="text"] {
    width: 70%;
}

.gantt-table input[type="number"] {
    width: 80px;
}

/* Select Dropdowns */
.gantt-table select {
    padding: 4px 6px;
    border: 1px solid var(--theme-border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    max-width: 200px;
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
}

/* Buttons in Table */
.gantt-table button {
    padding: 4px 8px;
    font-size: 12px;
}

.gantt-table button[data-action="toggle-other-teams"] {
    padding: 2px 6px;
}