* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
}

.container {
    max-width: 100%;
    padding: 30px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 28px;
    font-weight: 600;
}

.controls {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #d0d7de;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #d0d7de;
}

.timeline-controls label {
    font-size: 14px;
    font-weight: 500;
    color: #24292f;
}

.timeline-controls input[type="number"],
.timeline-controls select {
    padding: 6px 10px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
}

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

.timeline-controls select {
    width: 70px;
}

.export-controls {
    display: flex;
    gap: 10px;
}

.controls button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-right: 10px;
}

.controls button:hover {
    background-color: #2980b9;
}

#roadmap {
    overflow-x: auto;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    display: block;
}

#roadmap table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

#roadmap th {
    background-color: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
    border-right: 1px solid #d0d7de;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #24292f;
    position: sticky;
    top: 0;
    z-index: 10;
}

#roadmap th:last-child {
    border-right: none;
}

#roadmap th.year-header {
    background-color: #eef2f6;
    font-size: 15px;
    font-weight: 700;
    color: #0969da;
    border-bottom: 2px solid #0969da;
}

#roadmap th.period-header {
    background-color: #f6f8fa;
    font-size: 12px;
    min-width: 70px;
    font-weight: 700;
}

#roadmap thead tr:first-child th:first-child,
#roadmap thead tr:first-child th:nth-child(2) {
    background-color: #ffffff;
    border-bottom: 1px solid #d0d7de;
}

#roadmap td {
    border-bottom: 1px solid #d0d7de;
    border-right: 1px solid #d0d7de;
    padding: 12px;
    font-size: 14px;
    color: #24292f;
    vertical-align: top;
}

#roadmap td:last-child {
    border-right: none;
}

.category-cell {
    background-color: #ffffff;
    width: 250px;
    padding: 8px 12px;
    position: relative;
    min-height: 45px;
    flex-shrink: 0;
}

.deliverables-cell {
    background-color: #ffffff;
    width: 250px;
    padding: 8px 12px;
    min-height: 45px;
    flex-shrink: 0;
}

.deliverables-header {
    font-weight: 700;
    color: #24292f;
    font-size: 13px;
    margin-bottom: 2px;
}

.deliverables-subtitle {
    font-weight: 400;
    font-style: italic;
    color: #656d76;
    font-size: 11px;
    margin-bottom: 8px;
}

.deliverables-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
    font-size: 12px;
    color: #24292f;
}

.deliverables-list li {
    margin-bottom: 4px;
    outline: none;
}

.deliverables-list li:last-child {
    margin-bottom: 0;
}

.add-deliverable-btn {
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 11px;
    background-color: transparent;
    color: #0969da;
    border: 1px dashed #d0d7de;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.deliverables-cell:hover .add-deliverable-btn {
    opacity: 1;
}

.add-deliverable-btn:hover {
    background-color: #ddf4ff;
    border-color: #0969da;
    border-style: solid;
}

.deliverable-item {
    position: relative;
    padding-right: 20px;
}

.deliverable-text {
    outline: none;
    cursor: text;
}

.deliverable-text:hover {
    background-color: #f0f6fc;
    border-radius: 2px;
}

.deliverable-text:focus {
    background-color: #ddf4ff;
    border-radius: 2px;
}

.deliverable-delete-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border: none;
    background-color: transparent;
    color: #cf222e;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.deliverable-item:hover .deliverable-delete-btn {
    display: inline;
}

.deliverable-delete-btn:hover {
    opacity: 1;
}

.status-cell {
    background-color: #ffffff;
    width: 50px;
    padding: 8px;
    text-align: center;
    min-height: 45px;
    flex-shrink: 0;
}

.status-header-cell {
    width: 50px;
}

.traffic-light {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 auto;
    cursor: pointer;
    border: 2px solid #d0d7de;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.traffic-light:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.traffic-light.green {
    background-color: #1a7f37;
    border-color: #1a7f37;
}

.traffic-light.yellow {
    background-color: #f0c800;
    border-color: #d4b000;
}

.traffic-light.red {
    background-color: #cf222e;
    border-color: #cf222e;
}

.category-cell:hover .category-actions {
    opacity: 1;
}

.category-actions {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-btn {
    width: 22px;
    height: 22px;
    border: 1px solid #d0d7de;
    background-color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.category-btn:hover {
    background-color: #f6f8fa;
    border-color: #0969da;
}

.add-activity-btn {
    color: #1a7f37;
    font-size: 16px;
    font-weight: bold;
}

.add-activity-btn:hover {
    background-color: #dafbe1;
    border-color: #1a7f37;
}

.delete-btn {
    color: #cf222e;
    font-size: 18px;
    font-weight: bold;
}

.delete-btn:hover {
    background-color: #ffebe9;
    border-color: #cf222e;
}

.category-content {
    margin-left: 30px;
}

.category-header {
    font-weight: 700;
    color: #24292f;
    font-size: 14px;
    margin-bottom: 2px;
    outline: none;
}

.category-subtitle {
    font-weight: 400;
    font-style: italic;
    color: #656d76;
    font-size: 12px;
    outline: none;
}

.add-category-row {
    background-color: #f6f8fa;
}

.add-category-cell {
    padding: 8px 12px;
}

#addCategoryBtn {
    width: 100%;
    padding: 8px 12px;
    background-color: transparent;
    color: #0969da;
    border: 1px dashed #d0d7de;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    opacity: 0;
}

.add-category-row:hover #addCategoryBtn {
    opacity: 1;
}

#addCategoryBtn:hover {
    background-color: #ddf4ff;
    border-color: #0969da;
    border-style: solid;
}

.empty-cell {
    background-color: #f6f8fa;
}

#roadmap tbody tr:last-child td {
    border-bottom: 1px solid #d0d7de;
}

.timeline-cell {
    background-color: #ffffff;
    position: relative;
    cursor: default;
    min-height: 45px;
    padding: 0;
    min-width: 70px;
}

.activity-bar {
    background-color: #0969da;
    border-radius: 6px;
    cursor: grab;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background-color 0.2s, box-shadow 0.2s;
    user-select: none;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 8px;
}

.activity-bar::before {
    content: '⋮⋮';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    line-height: 1;
    letter-spacing: -2px;
    pointer-events: none;
}

.activity-bar:hover {
    background-color: #1f7fd0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.activity-bar.dragging {
    opacity: 0.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: grabbing;
}

.activity-bar.resizing {
    opacity: 0.7;
}

.activity-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    background-color: transparent;
    transition: background-color 0.2s;
}

.activity-resize-handle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.activity-delete-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.activity-bar:hover .activity-delete-btn {
    display: flex;
}

.activity-delete-btn:hover {
    background-color: rgba(207, 34, 46, 0.9);
}

.activity-name {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    padding-right: 26px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    line-height: 16px;
    outline: none;
    flex: 1;
    cursor: inherit;
}

.activity-name:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: text;
}

.activity-name:focus {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: text;
}

.timeline-cell.activity-active {
    background-color: #54aeff;
}

.timeline-cell.activity-start {
    background-color: #0969da;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.timeline-cell.activity-start.activity-end {
    border-radius: 6px;
}

.timeline-cell.activity-end {
    background-color: #0969da;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.timeline-cell.activity-active:not(.activity-start):not(.activity-end) {
    background-color: #0969da;
    border-radius: 0;
}

.activity-label {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.timeline-cell:hover {
    opacity: 0.85;
}

[contenteditable="true"] {
    outline: none;
    transition: background-color 0.2s;
}

[contenteditable="true"]:hover {
    background-color: #f0f6fc;
    cursor: text;
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
}

[contenteditable="true"]:focus {
    background-color: #ddf4ff;
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
}
