/* Timeline Tracker - Pastel Springtime Theme */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Quicksand:wght@300;400;500;600;700&display=swap');

/* Dark Mode (Default) */
:root {
    --bg-primary: #1a1625;
    --bg-secondary: #241f31;
    --bg-card: #2d2640;
    --bg-hover: #3d3555;
    --text-primary: #f5f0ff;
    --text-secondary: #b8a9d4;
    --text-muted: #6b5a8a;
    --accent: #b4e7ce;
    --accent-dim: #8fd4b3;
    --accent-secondary: #ffc9de;
    --warning: #ffe5a0;
    --danger: #ffb3b3;
    --success: #b4e7ce;
    --border: #3d3555;
    --shadow: rgba(180, 231, 206, 0.15);
    
    /* Pastel bar colors */
    --bar-complete: #b4e7ce;
    --bar-progress: #ffe5a0;
    --bar-notstarted: #c9b8e8;
    --bar-late: #ffb3b3;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #fef9f3;
    --bg-secondary: #fff5eb;
    --bg-card: #ffffff;
    --bg-hover: #fef0e5;
    --text-primary: #3d3250;
    --text-secondary: #6b5a8a;
    --text-muted: #a99bc2;
    --accent: #7bc9a6;
    --accent-dim: #5bb88c;
    --accent-secondary: #f5a0be;
    --warning: #e8c56c;
    --danger: #e8918a;
    --success: #7bc9a6;
    --border: #e8dff5;
    --shadow: rgba(123, 201, 166, 0.2);
    
    /* Pastel bar colors - slightly more saturated for light mode */
    --bar-complete: #7bc9a6;
    --bar-progress: #e8c56c;
    --bar-notstarted: #b8a9d4;
    --bar-late: #e8918a;
}

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

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(180, 231, 206, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 201, 222, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(201, 184, 232, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
    transition: background 0.3s ease;
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(123, 201, 166, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(245, 160, 190, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(184, 169, 212, 0.1) 0%, transparent 60%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 50%, #c9b8e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 1.1rem;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.btn-primary {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-theme {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.btn-theme:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: rotate(20deg);
}

.icon {
    font-size: 1.1rem;
}

.status {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    transition: all 0.3s ease;
}

.year-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 80px;
    text-align: center;
}

.btn-nav {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nav:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-zoom {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-zoom:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-zoom.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

/* Timeline Container */
.timeline-container {
    background: var(--bg-card);
    border-radius: 0 0 16px 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 400px;
    position: relative;
    transition: all 0.3s ease;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-secondary);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Date Editor Section */
.date-editor {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.date-editor h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.date-inputs {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.date-row {
    display: grid;
    grid-template-columns: 1fr 150px 150px auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.date-row:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
}

.date-row .board-name {
    font-weight: 500;
    color: var(--text-primary);
}

.date-row .board-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-complete { background: rgba(180, 231, 206, 0.25); color: var(--bar-complete); }
.status-progress { background: rgba(255, 229, 160, 0.25); color: var(--warning); }
.status-notstarted { background: rgba(201, 184, 232, 0.25); color: var(--bar-notstarted); }
.status-late { background: rgba(255, 179, 179, 0.25); color: var(--bar-late); }

[data-theme="light"] .status-complete { background: rgba(123, 201, 166, 0.2); color: #4a9f7a; }
[data-theme="light"] .status-progress { background: rgba(232, 197, 108, 0.2); color: #b89940; }
[data-theme="light"] .status-notstarted { background: rgba(184, 169, 212, 0.2); color: #7a6899; }
[data-theme="light"] .status-late { background: rgba(232, 145, 138, 0.2); color: #c4635c; }

[data-theme="light"] .summary-board.complete .board-status-badge { background: rgba(123, 201, 166, 0.2); color: #4a9f7a; }
[data-theme="light"] .summary-board.progress .board-status-badge { background: rgba(232, 197, 108, 0.2); color: #b89940; }
[data-theme="light"] .summary-board.late .board-status-badge { background: rgba(232, 145, 138, 0.2); color: #c4635c; }

input[type="date"] {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow);
}

/* Summary Section */
.summary {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.summary h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Board Summary Card */
.summary-board {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.summary-board[open] {
    border-color: var(--accent);
}

.summary-board.complete { border-left: 4px solid var(--bar-complete); }
.summary-board.progress { border-left: 4px solid var(--bar-progress); }
.summary-board.late { border-left: 4px solid var(--bar-late); }
.summary-board.notstarted { border-left: 4px solid var(--bar-notstarted); }

.board-header {
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.board-header::-webkit-details-marker {
    display: none;
}

.board-header:hover {
    background: var(--bg-hover);
}

.board-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.board-name-link {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.board-name-link:hover {
    color: var(--accent);
}

.board-status-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-board.complete .board-status-badge { background: rgba(180, 231, 206, 0.2); color: var(--bar-complete); }
.summary-board.progress .board-status-badge { background: rgba(255, 229, 160, 0.2); color: var(--warning); }
.summary-board.late .board-status-badge { background: rgba(255, 179, 179, 0.2); color: var(--bar-late); }

.board-meta {
    display: flex;
    gap: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-count {
    color: var(--text-secondary);
}

/* Board Details (expanded) */
.board-details {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
}

.detail-section {
    margin-top: 1rem;
}

.detail-section h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Members */
.board-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.member-avatar:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.member-initial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards List */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 1rem;
}

.card-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: translateX(4px);
}

.card-name {
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-due {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.card-due.no-due {
    color: var(--text-muted);
    font-style: italic;
}

.cards-more {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
}

.no-cards {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* Settings Section */
.settings {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.settings details {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.settings summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    transition: all 0.3s ease;
}

.settings summary::-webkit-details-marker {
    display: none;
}

.settings summary:hover {
    color: var(--text-primary);
}

.settings-icon {
    font-size: 1.1rem;
}

.settings details[open] summary {
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.settings-content {
    padding: 1.5rem;
}

.settings-row {
    margin-bottom: 1rem;
}

.settings-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.settings-row input {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.settings-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow);
}

.settings-row input::placeholder {
    color: var(--text-muted);
}

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.btn-secondary {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.settings-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.settings-hint a {
    color: var(--accent);
    text-decoration: none;
}

.settings-hint a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .date-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .timeline-controls {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Plotly overrides */
.js-plotly-plot .plotly .modebar {
    background: var(--bg-card) !important;
}

.js-plotly-plot .plotly .modebar-btn path {
    fill: var(--text-secondary) !important;
}
