/* --- START OF FILE style.css --- */

/* Basic Reset & Body */
:root {
    --ui-bg: #f4f7f6;
    --ui-surface: #ffffff;
    --ui-border: #cfd8dc;
    --ui-text: #333;
    --ui-text-muted: #555;
    --ui-accent: #3498db;
    --ui-accent-strong: #2980b9;
    --ui-focus: #1f6fb2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    line-height: 1.6;
    background: linear-gradient(180deg, #f8fbfa 0%, var(--ui-bg) 100%);
    color: var(--ui-text);
    padding: 15px;
}

h1, h2, h3, h4 {
    margin-bottom: 0.75em;
    color: #2c3e50;
    font-weight: 600;
}

h1 {
    text-align: center;
    color: #34495e;
}

button {
    padding: 8px 15px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background-color: var(--ui-accent);
    color: white;
    margin: 5px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    background-color: var(--ui-accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ui-focus) 45%, transparent);
    outline-offset: 1px;
}

dialog {
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 25px;
    min-width: 320px;
    max-width: 700px; /* Slightly wider for multi-assign checkboxes */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--ui-surface);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
dialog h2 {
    margin-top: 0;
    color: #3498db;
}

/* Header & Sprint Info */
header {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #3498db;
}
header h1 {
    flex-basis: 100%;
    margin-bottom: 10px;
    text-align: left;
}
@media (min-width: 600px) {
    header h1 {
        flex-basis: auto;
        margin-bottom: 0;
    }
}


#sprint-info {
    text-align: right;
    background-color: var(--ui-surface);
    padding: 10px;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #dde4e8;
}

#sprint-info h2 {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: #2c3e50;
}

#sprint-info p {
    margin-bottom: 5px;
    font-size: 0.95em;
    color: var(--ui-text-muted);
}
#sprint-info p span {
    font-weight: 600;
    color: #333;
}


/* Game Layout */
.game-container {
    display: flex;
    gap: 15px;
}

#game-notice-region {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.game-notice {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #dbe5eb;
    background: #f8fbfd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.game-notice-message {
    flex: 1;
    font-size: 0.95rem;
    color: #22313f;
}

.game-notice-dismiss {
    margin: 0;
    padding: 4px 10px;
    background-color: transparent;
    color: #51606d;
    border: 1px solid #c7d4dd;
}

.game-notice-dismiss:hover {
    background-color: #ecf3f7;
}

.game-notice-info {
    border-left: 4px solid #3498db;
}

.game-notice-warning {
    border-left: 4px solid #f39c12;
    background: #fff8eb;
}

.game-notice-error {
    border-left: 4px solid #e74c3c;
    background: #fff1f0;
}

.game-notice-success {
    border-left: 4px solid #2ecc71;
    background: #effaf3;
}

#product-backlog-column {
    flex: 1;
    min-width: 180px;
}

.kanban-board-container {
    flex: 4;
    display: flex;
    gap: 10px;
}

#team-status {
    flex: 1;
    min-width: 200px;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: flex-start;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}
#team-status h2 {
    font-size: 1.2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 1;
}

#team-insights-panel {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#team-insights-panel > h2 {
    font-size: 1rem;
    margin-bottom: 0;
    color: #34495e;
}

.sidebar-status-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    border: 1px solid #dbe5eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.sidebar-status-card h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #22313f;
}

.section-explanation {
    font-size: 0.82rem;
    color: #667784;
    margin-bottom: 8px;
}

#achievement-list,
#event-list,
#team-dynamics-list,
#coach-feedback-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.achievement-item,
.event-item,
.dynamics-item {
    background-color: #fff;
    border: 1px solid #e5edf2;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 8px 10px;
}

.achievement-item,
.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.achievement-item {
    border-left-color: #2ecc71;
}

.event-item {
    border-left-color: #3498db;
}

.achievement-name,
.event-name {
    font-weight: 600;
    color: #2c3e50;
}

.achievement-points,
.event-duration {
    font-size: 0.85rem;
    white-space: nowrap;
}

.achievement-points {
    color: #1e8449;
}

.event-duration {
    color: #21618c;
}

.dynamics-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dynamics-none {
    color: #6c7a89;
    font-style: italic;
}

.dynamics-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamics-icon {
    font-size: 1rem;
}

.dynamics-title {
    font-weight: 600;
    color: #2c3e50;
}

.dynamics-description {
    font-size: 0.85rem;
    color: #596b78;
}

.dynamics-effect {
    font-size: 0.82rem;
    color: #34495e;
    background: #f4f8fb;
    border-radius: 4px;
    padding: 6px 8px;
}

.dynamics-mentoring {
    border-left-color: #3498db;
}

.dynamics-teamChemistry {
    border-left-color: #27ae60;
}

.dynamics-burnout {
    border-left-color: #f39c12;
}

.coach-feedback-item {
    background: #fffef8;
    border: 1px solid #ece3c7;
    border-left: 4px solid #95a5a6;
    border-radius: 6px;
    padding: 9px 10px;
}

.coach-feedback-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.coach-feedback-body {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #5d6d7e;
}

.coach-info {
    border-left-color: #3498db;
    background: #f8fbff;
}

.coach-warning {
    border-left-color: #f39c12;
    background: #fff8ef;
}

.coach-success {
    border-left-color: #27ae60;
    background: #f4fcf7;
}


/* Kanban Columns & Lists */
.kanban-column-container,
.kanban-column {
    background-color: #e2eaed;
    padding: 10px;
    border-radius: 8px;
    height: fit-content;
    min-height: 450px;
    border: 1px solid #cfdbdf;
}

.kanban-column {
     flex: 1;
     display: flex;
     flex-direction: column;
}
.kanban-column h3 {
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #bdc3c7;
    color: #34495e;
}

/* WIP Limit Styling */
.wip-limit {
    font-size: 0.85em;
    font-weight: normal;
    color: #555;
    margin-left: 5px;
    display: inline-block;
    background-color: #ecf0f1;
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid #bdc3c7;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.wip-limit.exceeded {
    color: white;
    font-weight: bold;
    background-color: #e74c3c;
    border-color: #c0392b;
}


.story-list {
    min-height: 150px;
    background-color: #f6f8f9;
    border-radius: 6px;
    padding: 7px;
    flex-grow: 1;
    border: 1px dashed #c7d1d5;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

/* Story Card Styling */
.story-card {
    background-color: var(--ui-surface);
    border: 1px solid #ccd6db;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 0.9em;
    transition: border-left-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    border-left-width: 4px;
    border-left-color: transparent;
}

.story-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.story-card[data-blocked="true"] {
    border-left-color: orange !important;
    box-shadow: 0 2px 6px rgba(255, 165, 0, 0.3);
}
.story-card .story-age.aging {
    border: 1px solid #e74c3c;
    background-color: #fbeeef;
    color: #c0392b;
}


.story-card h4 {
    margin-bottom: 4px;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.story-meta {
    font-size: 0.9em;
    color: #777;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 4px;
    gap: 5px 10px;
}
.story-meta span span {
    font-weight: bold;
    color: #555;
}
.story-age {
    font-size: 0.8em;
    color: #999;
    background-color: #f0f0f0;
    padding: 0 4px;
    border-radius: 3px;
    font-style: italic;
}

.story-tags {
    margin-bottom: 4px;
    line-height: 1.5;
}

.tag {
    display: inline-block;
    font-size: 0.8em;
    padding: 1px 5px;
    border-radius: 10px;
    color: white;
    margin-right: 3px;
    margin-bottom: 2px;
}

/* Tag Colors */
.tag-visual { background-color: #3498db; }
.tag-text { background-color: #2ecc71; }
.tag-activity { background-color: #f1c40f; color: #333; }
.tag-marketing { background-color: #9b59b6; }
.tag-design { background-color: #e74c3c; }
.tag-character { background-color: #1abc9c; }
.tag-plot { background-color: #e67e22; }
.tag-setting { background-color: #7f8c8d; }
.tag-dialogue { background-color: #34495e; }
.tag-climax { background-color: #c0392b; }
.tag-resolution { background-color: #27ae60; }
.tag-testing { background-color: #f39c12; }


/* Worker Assignment Styling */
.story-assignment {
    font-size: 0.9em;
    color: #888;
    margin-top: 4px;
    margin-bottom: 4px;
    line-height: 1.6; /* Better spacing for pills */
}
/* Target the span holding the pills */
.story-assignment .story-worker {
    font-style: normal; /* Remove italic */
    color: inherit; /* Inherit color from parent */
}

/* Worker Pill Styling */
.worker-pill {
    display: inline-block;
    font-size: 0.8em;
    padding: 1px 6px;
    border-radius: 10px;
    color: white;
    margin-right: 3px;
    margin-bottom: 3px; /* Spacing between pills */
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2); /* Subtle shadow */
    border: 1px solid rgba(0,0,0,0.1);
}


/* Blocker Info Styling */
.blocker-info {
    color: orange;
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 4px;
    display: none; /* Hidden by default, shown by JS */
}


/* Progress Bar Styling */
.story-progress, .story-testing-progress {
    margin-top: 5px;
    font-size: 0.85em;
}
.story-progress label, .story-testing-progress label {
    display: inline-block;
    width: 35px;
    color: #555;
    font-weight: 500;
}
.story-progress progress, .story-testing-progress progress {
    width: calc(100% - 90px); /* Adjusted width */
    height: 10px;
    vertical-align: middle;
    margin: 0 5px;
    border-radius: 5px;
    overflow: hidden; /* Ensure border radius applies */
}
/* Progress bar colors */
progress::-webkit-progress-bar {
    background-color: #eee;
    border-radius: 5px;
}
progress.dev-progress::-webkit-progress-value {
    background-color: #2ecc71; /* Green for dev */
    border-radius: 5px;
    transition: width 0.3s ease;
}
progress.test-progress::-webkit-progress-value {
    background-color: #f39c12; /* Orange for testing */
    border-radius: 5px;
     transition: width 0.3s ease;
}
/* Firefox specific */
progress.dev-progress::-moz-progress-bar {
    background-color: #2ecc71;
    border-radius: 5px;
     transition: width 0.3s ease;
}
progress.test-progress::-moz-progress-bar {
    background-color: #f39c12;
    border-radius: 5px;
     transition: width 0.3s ease;
}


/* Style for points remaining spans */
.dev-points-remaining, .test-points-remaining {
    display: inline-block;
    width: 40px;
    text-align: right;
    color: #555;
    font-weight: 500;
    font-size: 0.9em;
    vertical-align: middle;
}


/* SortableJS Helper Class (Not used visually now) */
.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
}

/* Worker Status */
.worker-status {
    background-color: #f8f9fa;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 6px;
    font-size: 0.9em;
    border-left: 4px solid #bdc3c7;
    transition: border-color 0.3s ease;
    border-top: 1px solid #e4eaee;
    border-right: 1px solid #e4eaee;
    border-bottom: 1px solid #e4eaee;
}
/* Update border colors based on data-state attribute set by JS */
.worker-status[data-state="idle"] { border-left-color: #2ecc71; } /* Green */
.worker-status[data-state="working"] { border-left-color: #3498db; } /* Blue */
.worker-status[data-state="unavailable"] { border-left-color: #e74c3c; } /* Red */
.worker-status[data-state="unblocking"] { border-left-color: #f39c12; } /* Orange */
.worker-status[data-state="blocked"] { border-left-color: #e74c3c; } /* Red (when assigned to blocked story) */

.worker-avatar {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    border: 1px solid #ccc;
}


/* Assignment/Reassignment Modal Item Spacing & Styling */
.assignment-item, .reassignment-item, .blocker-assignment-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.assignment-item:last-child, .reassignment-item:last-child, .blocker-assignment-item:last-child {
    border-bottom: none; /* Remove border from last item */
}

/* Label for the whole section (e.g., "Assign Workers:") */
.assignment-item > label, .reassignment-item > label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* Container for checkboxes */
.worker-checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px; /* Row and column gap */
    padding-left: 10px; /* Indent checkboxes slightly */
}

/* Individual checkbox + label wrapper */
.worker-checkbox-option {
    display: flex; /* Align checkbox and label */
    align-items: center;
}
.worker-checkbox-option input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}
.worker-checkbox-option label {
    font-weight: normal; /* Normal weight for worker names */
    cursor: pointer;
}
.worker-checkbox-option input[type="checkbox"]:disabled + label {
    color: #aaa; /* Gray out text for disabled workers */
    cursor: not-allowed;
    text-decoration: line-through; /* Optional: strike-through */
}

/* Sprint Planning Modal Layout */
#planning-backlog-selection {
    margin-top: 10px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#planning-backlog-selection > div {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 6px 10px;
    padding: 10px 12px;
    border: 1px solid #d6e0e6;
    border-radius: 8px;
    background: #ffffff;
}

#planning-backlog-selection > div > input[type="checkbox"] {
    margin-top: 3px;
}

#planning-backlog-selection > div > label {
    margin: 0;
    font-weight: 700;
    color: #2c3e50;
}

/* Read-only implementation options line injected under each story label */
#planning-backlog-selection > div > div {
    grid-column: 2;
    margin-top: 2px;
    padding: 6px 8px;
    border: 1px dashed #d3dfe6;
    border-radius: 6px;
    background: #f8fbfd;
    color: #5d6d7e;
    font-size: 0.86em;
    line-height: 1.35;
    white-space: pre-line;
}

/* Blocker assignment select styling (remains mostly the same) */
.blocker-assignment-item label {
    margin-right: 5px;
    font-weight: 500;
}
.blocker-assignment-item select {
    padding: 4px 6px;
    margin-left: 5px;
    min-width: 180px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.blocker-assignment-item select option:disabled {
    color: #aaa;
    background-color: #f8f8f8;
}

/* Styling for Daily Scrum Reassignment Sections */
.reassignment-item .current-workers-list,
.reassignment-item .add-workers-list {
    margin-top: 8px;
    padding-left: 10px;
}
.reassignment-item .current-workers-list label,
.reassignment-item .add-workers-list label {
    font-weight: 500; /* Slightly bolder label for sections */
    display: block;
    margin-bottom: 5px;
}
/* Styling for the "keep" checkbox/label in reassignment */
.worker-remove-label {
    display: inline-flex; /* Align checkbox and pill */
    align-items: center;
    margin-left: 3px;
    margin-right: 10px; /* Space between workers */
    cursor: pointer;
}
.worker-remove-label input[type="checkbox"] {
    margin-right: 4px;
    cursor: pointer;
}
/* Make the worker pill part of the label */
.worker-remove-label .worker-pill {
    vertical-align: middle;
}


/* Retrospective Text Areas */
#retro-form textarea {
    width: 95%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: inherit;
    font-size: 0.95em;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
#retro-form label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    margin-left: 2.5%;
}


/* Final Storybook Preview */
#review-storybook-preview, #final-storybook-pages {
    border: 1px dashed #ccc;
    padding: 15px;
    min-height: 100px;
    margin-top: 10px;
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.storybook-page-preview {
    border: 1px solid #eee;
    padding: 10px;
    text-align: center;
    max-width: 180px;
    background-color: #fdfdfd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.storybook-page-preview h5 {
    font-size: 1em;
    margin-bottom: 8px;
    color: #333;
}

.storybook-page-preview img {
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
    border-radius: 3px;
    object-fit: contain;
    max-height: 100px;
    flex-shrink: 0;
}

.storybook-page-preview p {
    font-size: 0.85em;
    color: #444;
    flex-grow: 1;
    margin-top: auto;
    text-align: left;
    hyphens: auto;
    word-break: break-word;
}

.review-scorecard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 12px 0 16px;
}

.review-score-item {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
    border: 1px solid #dde6ec;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-score-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7b88;
}

.review-score-item span:last-child {
    font-size: 1.05rem;
    font-weight: 700;
    color: #22313f;
}

.review-outcome-summary {
    margin: 10px 0 18px;
    padding: 12px 14px;
    background: #f8fbfd;
    border: 1px solid #dbe7ef;
    border-left: 4px solid #3498db;
    border-radius: 8px;
}

.review-outcome-summary h3 {
    margin-bottom: 6px;
}

#review-outcome-title {
    font-weight: 700;
    color: #22313f;
    margin-bottom: 4px;
}

#review-outcome-detail {
    color: #5d6d7e;
    line-height: 1.5;
}

/* DoD Status in Final Modal */
#final-storybook-pages > div:first-child { /* Target the DoD status div */
     width: 100%;
     border: 1px solid #ccc;
     background-color: #f9f9f9;
     border-radius: 4px;
     padding: 15px;
     margin-bottom: 20px;
}
#final-storybook-pages > div:first-child h3 {
    margin-top: 0;
    color: #3498db;
}
#final-storybook-pages > div:first-child ul {
    margin-top: 5px;
    padding-left: 20px;
    list-style: disc;
}


/* Responsive adjustments */
@media (max-width: 1100px) {
    .game-container {
        flex-direction: column;
    }
     .kanban-board-container {
       flex-direction: row;
       overflow-x: auto;
       padding-bottom: 10px;
    }
    .kanban-column {
        min-width: 200px;
        max-width: 280px;
    }
     #team-status {
        min-width: unset;
        width: 100%;
        max-height: 250px;
    }
    .story-list {
         max-height: 300px;
    }
}

@media (max-width: 768px) {
    .kanban-column {
        min-width: 180px;
    }
    header {
        flex-direction: column;
        align-items: stretch;
    }
    header h1 { text-align: center; }
    #sprint-info { text-align: center; margin-top: 10px; }
    #team-status {
         max-height: 200px;
    }
    dialog {
        min-width: 90%;
        max-width: 95%;
        padding: 18px;
    }
     #retro-form textarea, #retro-form label {
        width: 90%;
        margin-left: 5%;
        margin-right: 5%;
     }
    /* Improve checkbox layout on small screens */
    .worker-checkbox-container {
        display: grid; /* Switch to grid for better control */
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive columns */
        gap: 5px;
        padding-left: 0; /* Remove indent on small screens */
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
/* --- END OF FILE style.css --- */
