/* Color Variables */
:root {
    --primary-dark: #283c54;    /* Navy */
    --primary-blue: #40b5f9;    /* Mid blue */
    --primary-light: #b6f4fe;   /* Light blue */
    --accent-purple: #7c3fe6;   /* Purple */
    --background-light: #f8f9fa;
}

/* Base Layout */
body {
    background: var(--background-light);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 60px;
    width: auto;
}

/* Sprint Box Styles */
.sprint-metrics.current-sprint {
    background: var(--primary-dark);
    color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(40, 60, 84, 0.2);
}

.sprint-metrics h3,
.sprint-metrics .sprint-dates {
    color: white;
}

/* Epic Card Styles */
.epic-summary-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-dark);
}

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

.epic-header h3 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 120px);
}

/* Epic Metrics Styles */
.epic-metrics {
    display: flex;
    gap: 10px;  /* Further reduced from 15px */
    padding: 12px 15px;  /* Added more right padding */
    background: white;
    border-radius: 6px;
    margin: 0 0 15px 0;
    justify-content: flex-end;
    border-left: 3px solid var(--primary-blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: auto;  /* Changed from 100% to auto */
}

.epic-metric {
    display: flex;
    align-items: center;
    gap: 4px;  /* Further reduced from 6px */
    min-width: 110px;  /* Reduced from 120px */
    max-width: 120px;  /* Added max-width */
    justify-content: flex-end;
    flex-shrink: 1;
}

.epic-metric .metric-label {
    color: #555;
    font-size: 0.85em;  /* Slightly smaller */
    white-space: nowrap;
    font-weight: 500;
    /*overflow: hidden; */
    text-overflow: ellipsis;
}

.epic-metric .metric-value {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95em;  /* Slightly smaller */
    min-width: 35px;  /* Reduced from 40px */
    text-align: right;
    flex-shrink: 0;
    padding-left: 4px;  /* Add a little space between label and value */
}

/* Remove the extra right margin we added earlier */
.epic-metric:not(:last-child) {
    margin-right: 0;
}

/* Progress percentage should stand out */
.epic-metric:last-child .metric-value {
    color: var(--primary-blue);  /* Make progress percentage blue */
}

/* Points and Badges */
.feature-points, 
.epic-points {
    background: var(--primary-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* Features List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--background-light);
    border-radius: 6px;
}

.feature-item:hover {
    background: linear-gradient(to right, var(--background-light), #f0f7ff);
}

.feature-title {
    font-size: 0.95em;
    color: #444;
}

/* Points Explanation */
.points-explanation {
    padding: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    text-align: center;
    width: 100%;  /* Ensure it takes full width */
    box-sizing: border-box;  /* Include padding in width calculation */
    border-left: 3px solid var(--primary-dark);
}

/* Grid Layout */
.initiatives-summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Responsive Design */
@media screen and (max-width: 1400px) {
    .initiatives-summary-container {
        grid-template-columns: 1fr;
    }
}

.story-card {
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.state-new { background-color: #f8f9fa; }
.state-active { background-color: #e8f4f8; }
.state-resolved { background-color: #e8f8e8; }
.state-closed { background-color: #f8e8e8; }

#last-updated {
    color: #666;
    font-style: italic;
    margin-bottom: 0;
}

.stories-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-size: 1.1em; /* Larger font for TV display */
}

.stories-table th,
.stories-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.stories-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.stories-table td.points {
    text-align: center;
}

.stories-table thead th:nth-child(1), /* Status column */
.stories-table tbody td:nth-child(1) {
    width: 100px;
}

.stories-table thead th:nth-child(2), /* Points column */
.stories-table tbody td:nth-child(2) {
    width: 80px;
    text-align: center;
}

.stories-table thead th:nth-child(3), /* Description column */
.stories-table tbody td:nth-child(3) {
    width: auto; /* Takes remaining space */
}

/* Status-based row colors */
.status-active {
    background-color: rgba(255, 152, 0, 0.1);  /* Light orange */
}

.status-new {
    background-color: rgba(33, 150, 243, 0.1);  /* Light blue */
}

.status-resolved, .status-closed {
    background-color: rgba(76, 175, 80, 0.1);  /* Light green */
}

.status-on-hold {
    background-color: rgba(158, 158, 158, 0.1);  /* Light grey */
}

/* Hover effect on rows */
.stories-table tbody tr:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Link styling */
.stories-table a {
    color: #1976d2;
    text-decoration: none;
}

.stories-table a:hover {
    text-decoration: underline;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    padding: 20px;
    border-radius: 8px;
    color: white;
    text-align: center;
}

.metric-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.metric-numbers {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-value {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
}

.metric-points {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Metric Card Colors */
.metric-card.pending { background-color: #2196F3; }     /* Blue */
.metric-card.in-progress { background-color: #FF9800; } /* Orange */
.metric-card.completed { background-color: #4CAF50; }   /* Green */
.metric-card.on-hold { background-color: #9E9E9E; }     /* Grey */

/* Total Metrics */
.total-metrics {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

/* Tables Grid Layout */
.tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    height: calc(100vh - 400px); /* Set fixed height for grid */
}

.table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent container overflow */
}

.table-container h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
}

/* Make table body scrollable */
.stories-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
    display: block; /* Changed to block */
    overflow-y: auto; /* Enable vertical scrolling */
    height: 100%; /* Take full height of container */
}

.stories-table thead,
.stories-table tbody,
.stories-table tr {
    display: table; /* Keep table structure */
    width: 100%;
    table-layout: fixed; /* Maintain column widths */
}

.stories-table thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    width: 100%;
}

/* Remove duplicate properties */
.table-container {
    height: 100%; /* Take full height of grid cell */
}

/* Make the metrics section span full width above tables */
.metrics-grid {
    margin-bottom: 30px;
}

.total-metrics {
    margin-bottom: 30px;
}

/* Responsive adjustments */
@media screen and (max-width: 1400px) {
    .tables-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Keep headers visible while scrolling table body */
.stories-table thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

/* Responsive font sizes for TV display */
@media screen and (min-width: 1920px) {
    html { font-size: 18px; }
    .metric-value { font-size: 3em; }
}

/* Header styling */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    color: #666;
    font-style: italic;
}

.logo {
    height: 60px;
    width: auto;
}

/* Initiative Dashboard Styles when showing multiple sprints */
.sprints-container-multiple {
    margin-bottom: 30px;
}

.sprints-container-multiple .sprint-metrics {
    background: white;
    border-radius: 8px;
    padding: 15px;  /* Reduced from 20px */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sprints-container-multiple .sprint-metrics.current-sprint {
    border: none;
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 8px rgba(40, 60, 84, 0.2);
}

.sprints-container-multiple .sprint-metrics.current-sprint h3,
.sprints-container-multiple .sprint-metrics.current-sprint .sprint-dates {
    color: white;
}


/* Sprint Metrics Section */
.sprints-container {
    margin-bottom: 30px;
}

.sprint-metrics {
    background: white;
    border-radius: 8px;
    padding: 15px;  /* Reduced from 20px */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sprint-metrics.current-sprint {
    border: none;
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 8px rgba(40, 60, 84, 0.2);
}

.sprint-metrics.current-sprint h3,
.sprint-metrics.current-sprint .sprint-dates {
    color: white;
}


.sprint-metrics h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.4em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}


.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.metric-section {
    padding: 12px;
    background: transparent;  /* Remove white background */
}

.metric-section h4 {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    color: white;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.metric-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.metric-stat {
    background: rgba(255, 255, 255, 0.1);  /* Semi-transparent white background */
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);  /* Slightly dimmed white */
}

.stat-value {
    color: white;
    font-weight: 500;
}

.stat-value.points {
    color: var(--primary-light);  /* Light blue for points */
    font-weight: 600;
}

.metric-row.total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.metric-row.total .metric-stat {
    background: rgba(255, 255, 255, 0.15);  /* Slightly more visible for totals */
    font-weight: 500;
}

/* Initiative Hierarchy Section */
.initiatives-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.epic-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.epic-header h3 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.2em;  /* Slightly smaller base font */
    white-space: nowrap;  /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;  /* Show ... when text overflows */
    max-width: calc(100% - 120px);  /* Leave room for points */
}

.epic-points {
    font-size: 1em;  /* Slightly smaller */
    color: #1976d2;
    padding: 4px 8px;  /* Reduced padding */
    border-radius: 12px;
    background: rgba(25, 118, 210, 0.1);
    font-weight: 500;
    white-space: nowrap;  /* Prevent points from wrapping */
    flex-shrink: 0;  /* Prevent points from shrinking */
}

/* Add tooltip functionality for truncated titles */
.epic-header h3:hover {
    position: relative;
}

.epic-header h3:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--primary-dark);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    z-index: 1;
    white-space: normal;  /* Allow wrapping in tooltip */
    max-width: 300px;
    margin-top: 5px;
}

/* Adjust epic card layout */
.epic-summary-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-dark);
}

.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.feature-container {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.feature-header h4 {
    margin: 0;
    color: #444;
    font-size: 1.2em;
}

.stories-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-item {
    display: grid;
    grid-template-columns: auto 60px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    background: white;
}

.story-state {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    text-align: center;
}

.story-points {
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

.story-title {
    color: #1976d2;
    text-decoration: none;
    font-size: 0.95em;
}

.story-title:hover {
    text-decoration: underline;
}

/* Status Colors */
.status-new .story-state {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
}

.status-active .story-state {
    background: rgba(255, 152, 0, 0.1);
    color: #f57c00;
}

.status-resolved .story-state,
.status-closed .story-state {
    background: rgba(76, 175, 80, 0.1);
    color: #388e3c;
}

.status-on-hold .story-state {
    background: rgba(158, 158, 158, 0.1);
    color: #616161;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .sprints-container {
        grid-template-columns: 1fr;
    }
    
    .features-container {
        grid-template-columns: 1fr;
    }
}

/* Initiative Summary Styles */
.initiatives-summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.epic-summary-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.epic-summary-card .epic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    gap: 15px;  /* Add space between title and points */
}

.epic-summary-card h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.feature-title {
    font-size: 1.1em;
    color: #444;
}

.feature-state {
    font-size: 0.9em;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    background: #eee;
}

.feature-points {
    font-size: 0.9em;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(25, 118, 210, 0.1);
    font-weight: 500;
}

.sprint-header {
    margin-bottom: 4px;
    border-bottom: none;  /* Remove any bottom border */
}

.sprint-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
}

.sprint-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3em;
    border-bottom: none;  /* Ensure no border from h3 either */
}

.sprint-dates {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
}


.metrics-grid {
    gap: 15px;  /* Reduced from 30px */
}

.metric-section {
    padding: 12px;  /* Reduced from 20px */
}

.metric-section h4 {
    margin: 0 0 12px 0;  /* Reduced from 20px */
    padding-bottom: 8px;  /* Reduced from 10px */
}

.metric-stats {
    gap: 8px;  /* Reduced from 15px */
}

.metric-stat {
    padding: 8px;  /* Reduced from 10px */
}

/* Adjust spacing in metric rows */
.metric-row {
    gap: 10px;  /* Reduced from 15px */
    margin-bottom: 4px;  /* Reduced from 5px */
}

.metric-row.total {
    margin-top: 8px;  /* Reduced from 10px */
    padding-top: 8px;  /* Reduced from 10px */
}

/* Add some responsive behavior */
@media screen and (max-width: 1400px) {
    .sprints-container {
        flex-direction: column;
    }
    .previous-sprints-container {
        flex: auto;
    }
    .sprint-metrics.current-sprint {
        flex: auto;
    }
}

/* Update points badges */
.feature-points, .epic-points {
    background: var(--primary-dark);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Update the points explanation box */

/* Add subtle gradient to the page background */
body {
    background: linear-gradient(135deg, #fff, #f8f9fa);
}

/* Update hover states */
.epic-header h3:hover::after {
    background: var(--primary-dark);
}

.feature-item:hover {
    background: linear-gradient(to right, #f8f9fa, #f0f7ff);
}

/* Update primary colors to match brand */
:root {
    --primary-dark: #283c54;    /* Navy - for headers and primary text */
    --primary-blue: #40b5f9;    /* Fixed hex code */
    --primary-light: #b6f4fe;   /* Fixed hex code */
    --accent-purple: #7c3fe6;   /* Purple - for accents and important metrics */
    --gradient-bg: linear-gradient(135deg, #283c54, #40b5f9, #7c3fe6);
} 

/* Historical Issues Dashboard Styles */
.metrics-section {
    margin-bottom: 30px;
}

.metrics-section h2 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-period {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-blue);
}

.metric-period h3 {
    color: var(--primary-dark);
    margin: 0 0 15px 0;
    font-size: 1.2em;
    text-align: center;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: #666;
}

.metric-value {
    font-weight: bold;
    color: var(--primary-dark);
    font-size: 1.1em;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section h2 {
    color: var(--primary-dark);
    margin: 0 0 15px 0;
    font-size: 1.3em;
}

/* Responsive design for historical dashboard */
@media screen and (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-period {
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 768px) {
    .metric-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .metric-value {
        font-size: 1em;
    }
} 

/* Loading Indicator Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #666;
    font-size: 1.1em;
    margin: 0;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide loading when content is loaded */
.content-loaded .loading-container {
    display: none;
}