body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* Release Board Story Item Styles */
.release-story-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 5px 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
}

.release-story-item.level-0 {
    margin-left: 0px;
}

.release-story-item.level-1 {
    margin-left: 20px;
}

.release-story-item.level-2 {
    margin-left: 40px;
}

.release-story-item.level-3 {
    margin-left: 60px;
}

.release-story-item.level-4 {
    margin-left: 80px;
}

.release-story-item.level-5 {
    margin-left: 100px;
}

#main-container {
    display: flex;
    gap: 10px;
    height: calc(100vh - 10px);
}

#right-content {
    flex: 1;
    overflow-y: auto;
}

/* Inline priority label and popup (replaces native select) */
.priority-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.priority-label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 16px;
    background-color: #e8f0fe;
    /* light blue */
    color: #0b57d0;
    font-weight: 600;
    /* Reduce font size by ~30% for a more compact label */
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.priority-popup {
    position: absolute;
    top: 36px;
    left: 0;
    min-width: 120px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eee;
    padding: 6px 0;
    z-index: 1200;
}

.priority-option {
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    /* Slightly smaller options to match compact label */
    font-size: 0.85rem;
    line-height: 1.2;
}

.priority-option:hover {
    background-color: #eaf4ff;
    color: #0b57d0;
}

.priority-option.selected {
    background-color: #e1f0ff;
    font-weight: 700;
    color: #0b57d0;
}

/* Workflow state inline popup styles (match priority styling) */
.workflow-state-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.workflow-state-label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 16px;
    background-color: #f1f8e9;
    /* light green */
    color: #33691e;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.workflow-state-popup {
    position: absolute;
    top: 36px;
    left: 0;
    min-width: 120px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eee;
    padding: 6px 0;
    z-index: 1200;
}

.workflow-state-option {
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    font-size: 0.85rem;
}

.workflow-state-option:hover {
    background-color: #f0fff0;
    color: #33691e;
}

.workflow-state-option.selected {
    background-color: #e8f5e9;
    font-weight: 700;
    color: #33691e;
}

/* Persona inline popup styles */
.persona-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.persona-label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 16px;
    background-color: #fff3e0;
    /* light amber */
    color: #bf360c;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.persona-popup {
    position: absolute;
    top: 36px;
    left: 0;
    min-width: 140px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eee;
    padding: 6px 0;
    z-index: 1200;
}

.persona-option {
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    font-size: 0.85rem;
}

.persona-option:hover {
    background-color: #fff7ed;
    color: #bf360c;
}

.persona-option.selected {
    background-color: #fff3e0;
    font-weight: 700;
    color: #bf360c;
}

/* Release inline popup styles */
.targetRelease-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.targetRelease-label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 16px;
    background-color: #e3f2fd;
    /* light blue variant */
    color: #0d47a1;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.targetRelease-popup {
    position: absolute;
    top: 36px;
    left: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #eee;
    padding: 6px 0;
    z-index: 1200;
}

.targetRelease-option {
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    font-size: 0.85rem;
}

.targetRelease-option:hover {
    background-color: #e8f4ff;
    color: #0d47a1;
}

.targetRelease-option.selected {
    background-color: #e3f2fd;
    font-weight: 700;
    color: #0d47a1;
}

#milestoneControls {
    margin: 0 20px 20px 20px;
    display: inline-block;
}

#milestoneControls select,
#milestoneControls button {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-right: 10px;
}

#manageMilestonesBtn {
    background-color: #009688;
    color: white;
    border: none;
    cursor: pointer;
}

#manageMilestonesBtn:hover {
    background-color: #00796b;
}

#personaManagement {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#milestoneManagement {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#personaList {
    margin-bottom: 20px;
}

.persona-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.persona-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.persona-info {
    flex-grow: 1;
}

.persona-info h4 {
    margin: 0 0 5px 0;
}

.persona-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.persona-actions button {
    margin-left: 5px;
    padding: 3px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.milestone-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.milestone-info {
    flex-grow: 1;
}

.milestone-info h4 {
    margin: 0 0 5px 0;
}

#addPersonaForm input {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#addMilestoneForm input {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#recycleBin {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#recycleBinActions {
    margin-bottom: 15px;
}

#recycleBinActions button {
    margin-right: 10px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#restoreAllBtn {
    background-color: #4caf50;
    color: white;
}

#restoreAllBtn:hover {
    background-color: #45a049;
}

#clearBinBtn {
    background-color: #f44336;
    color: white;
}

#clearBinBtn:hover {
    background-color: #da190b;
}

.recycle-bin-story {
    background-color: #ffcdd2;
    border: 1px solid #f44336;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
}

.recycle-bin-story-controls {
    margin-top: 10px;
}

.recycle-bin-story-controls button {
    margin-right: 5px;
    padding: 3px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.restore-btn {
    background-color: #4caf50;
    color: white;
}

.permanent-delete-btn {
    background-color: #f44336;
    color: white;
}

.sticky-note {
    background-color: #fff9c4;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    width: 2.25in;
    height: 2.25in;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 5px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

/* Priority styling */
.sticky-note.priority-high {
    background-color: #ffcdd2;
    border-color: #f44336;
}

.sticky-note.priority-medium {
    background-color: #fff3e0;
    border-color: #ff9800;
}

.sticky-note.priority-low {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

/* Workflow state styling */
.workflow-state-to-do {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.workflow-state-on-hold {
    background-color: #fff3e0;
    border-color: #ff9800;
}

.workflow-state-done {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

/* Dimmed stories when filtering by priority */
.sticky-note.dimmed {
    opacity: 0.5;
}

/* Subtle dim for stories whose release is marked Done */
.sticky-note.released-done {
    opacity: 0.7;
    filter: grayscale(15%);
}

.sticky-note .multi-parent-indicator {
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: 16px;
    z-index: 15;
}

.sticky-note .parent-linkage-indicator {
    position: absolute;
    bottom: 0px;
    right: 1px;
    font-size: 16px;
    z-index: 10;
    color: #1976d2;
}

.sticky-note .dependency-counts {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.75rem;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 10rem;
    background-color: #6c757d;
    /* fallback gray */
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* variant colors when dependency counts indicate incoming/outgoing */
.sticky-note .dependency-counts.outgoing {
    background-color: #0d6efd;
    /* bootstrap primary */
}

.sticky-note .dependency-counts.incoming {
    background-color: #198754;
    /* bootstrap success */
}

.sticky-note .milestone-indicator {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    background-color: #009688;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 10;
}

.sticky-note .targetRelease-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    background-color: #009688;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 10;
}

.sticky-note.persona-highlight {
    border: 3px solid;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.sticky-note textarea {
    width: 100%;
    flex-grow: 1;
    border: none;
    background-color: transparent;
    resize: none;
    font-family: inherit;
}

.sticky-note textarea:focus {
    outline: none;
}

.story-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 5px;
    gap: 5px;
}

.priority-select {
    margin-right: 5px;
    padding: 2px;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 11px;
    flex: 1;
    min-width: 60px;
}

.workflow-state-select {
    margin-right: 5px;
    padding: 2px;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 11px;
    flex: 1;
    min-width: 60px;
}

/* Workflow state styling */

.milestone-select {
    margin-right: 5px;
    padding: 2px;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 11px;
    width: 80px;
    flex: 1;
    min-width: 60px;
}

.targetRelease-select {
    margin-right: 5px;
    padding: 2px;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 11px;
    width: 80px;
    flex: 1;
    min-width: 60px;
}

.story-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
    min-width: 100px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

td {
    padding: 5px;
    vertical-align: top;
    width: 2.5in;
}

.horizontal-flow>td {
    border-right: 1px dashed #ccc;
}

.horizontal-flow>td:last-child {
    border-right: none;
}

.vertical-flow>tr {
    border-bottom: 1px dashed #ccc;
}

.vertical-flow>tr:last-child {
    border-bottom: none;
}

.hidden-children {
    display: none;
}

/* Removed legacy custom modal styles in favor of Bootstrap modal */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group input[type="color"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    height: 40px;
}

/* Use Bootstrap's modal-footer and .btn styles instead of custom .modal-buttons */

#savePersonaBtn {
    background-color: #4caf50;
    color: white;
}

#savePersonaBtn:hover {
    background-color: #45a049;
}

#cancelEditPersonaBtn {
    background-color: #f44336;
    color: white;
}

#cancelEditPersonaBtn:hover {
    background-color: #da190b;
}

#newParentSelect {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Search container for move story modal */
.search-container {
    position: relative;
    margin: 10px 0;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-container button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 16px;
    color: #666;
}

.search-container button:hover {
    background: #e0e0e0;
}

/* Let Bootstrap handle modal sizing */

.dependency-section {
    margin: 20px 0;
}

.dependency-section h3 {
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.dependency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.story-id {
    font-weight: bold;
    color: #666;
    min-width: 30px;
}

.story-title {
    flex-grow: 1;
    margin: 0 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navigate-btn {
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.navigate-btn:hover {
    background-color: #1976d2;
}

.no-dependencies {
    color: #999;
    font-style: italic;
    padding: 10px;
}

#dependencyFlowContainer {
    width: 100%;
    height: calc(100vh - 120px);
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: auto;
    position: relative;
}

.dependency-node {
    position: absolute;
    background-color: #fff9c4;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    width: 150px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dependency-node:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.dependency-node.root {
    background-color: #e3f2fd;
}

.dependency-node.leaf {
    background-color: #e8f5e9;
}

.dependency-link {
    stroke: #999;
    stroke-width: 2px;
    marker-end: url(#arrowhead);
}

.dependency-link.cycle {
    stroke: #f44336;
    stroke-dasharray: 5, 5;
}

.legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
}

.legend-item {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid #ccc;
}

.legend-text {
    font-size: 12px;
}

#releaseManagement {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.targetRelease-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.targetRelease-info {
    flex-grow: 1;
}

.targetRelease-info h4 {
    margin: 0 0 5px 0;
}

.targetRelease-actions button {
    margin-left: 5px;
    padding: 3px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

#addReleaseForm input {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.add-root-btn {
    padding: 15px 25px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 20px;
}

.add-root-btn:hover {
    background-color: #45a049;
}

.context-menu {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 5px 0;
    min-width: 200px;
}

.context-menu-separator {
    height: 1px;
    background-color: #e0e0e0;
    margin: 5px 0;
}

.context-menu-columns {
    display: flex;
    min-width: 300px;
}

.context-menu-column {
    flex: 1;
    padding: 5px 0;
}

.context-menu-column:first-child {
    border-right: 1px solid #e0e0e0;
}

.context-menu-column-title {
    padding: 5px 15px;
    font-weight: bold;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.context-menu-item:hover {
    background-color: #f5f5f5;
}

/* Release Board Styles */
#releaseBoardControls {
    margin-bottom: 20px;
}

#releaseBoardControls button {
    padding: 10px;
    background-color: #009688;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

#releaseBoardControls button:hover {
    background-color: #00796b;
}

.targetRelease-section {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background-color: #f9f9f9;
}

.targetRelease-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.targetRelease-story-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 5px 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.targetRelease-story-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.targetRelease-story-children {
    margin-top: 5px;
    margin-left: 20px;
}

/* Highlight story when clicked from search results */
.highlight-story {
    animation: highlight-pulse 2s;
    box-shadow: 0 0 15px 5px #4caf50 !important;
    border: 2px solid #4caf50 !important;
    z-index: 100;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 5px 2px #4caf50;
    }

    50% {
        box-shadow: 0 0 20px 5px #4caf50;
    }

    100% {
        box-shadow: 0 0 5px 2px #4caf50;
    }
}

.ai-similar-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 5px;
    min-width: 200px;
}