:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --primary: #2c3e50;
    --accent: #3498db;
    --danger: #e74c3c;
    --text: #333333;
    --border: #dcdde1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

h1 {
    color: var(--primary);
    margin-top: 0;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 600px) {
    .upload-section { grid-template-columns: 1fr; }
}

.file-box {
    border: 2px dashed var(--border);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    background: #fafafa;
}

.file-box label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary);
}

.status {
    font-size: 0.85rem;
    margin-top: 5px;
    color: #7f8c8d;
}

.status.loaded { color: #27ae60; font-weight: bold; }

.control-section {
    margin-bottom: 25px;
    display: none;
}

select {
    padding: 10px;
    width: 100%;
    max-width: 300px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.roster-table th, .roster-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.roster-table th {
    background-color: #f8f9fa;
    color: var(--primary);
}

.disabled-row {
    color: #95a5a6;
    background-color: #fbfbfb;
}

.badge {
    background: #95a5a6;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.badge.undrafted { background: #e67e22; }
.badge.banned { background: var(--danger); }

.summary-card {
    background: #edf2f7;
    border-left: 4px solid var(--accent);
    padding: 15px;
    margin-top: 25px;
    border-radius: 0 4px 4px 0;
    display: none;
}

.summary-card h3 { margin-top: 0; color: var(--primary); }

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
}

.undrafted-player {
    color: #e67e22;
    font-weight: bold;
}

/* Switches traded player historical team tags to red */
.traded-player {
    color: #e74c3c;
    font-weight: bold;
}

.team-stats-panel {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f4f4f4;
    border-radius: 6px;
    font-size: 0.9em;
}

.position-boundary td {
    border-top: 3px solid #2c3e50;
}

.badge.three-season-warning {
    background: #e67e22;
    color: #fff;
}

.three-season-explanation {
    width: 100%;
    font-size: 0.85em;
    color: #e67e22;
    margin-top: 4px;
}

.badge.tie-breaker {
    background: #f1c40f;
    color: #2c2c2c;
}

/* ==================== TABS ==================== */

.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==================== CALENDAR (Draft Availability tab) ==================== */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 15px 0;
    max-width: 500px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    color: var(--primary);
    font-size: 0.8rem;
    padding-bottom: 4px;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: #fafafa;
    font-size: 0.9rem;
    user-select: none;
    transition: background 0.15s, color 0.15s;
}

.calendar-cell:hover { background: #eef3f7; }

.calendar-cell.empty {
    border: none;
    cursor: default;
    background: transparent;
}

.calendar-cell.unavailable {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    font-weight: bold;
}

.save-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

.save-btn:hover { background: #2d80b8; }

.best-day-row td {
    background: #eafaf1;
}

.calendar-cell {
    position: relative;
    flex-direction: column;
}

.cal-hours-count {
    font-size: 0.6rem;
    font-weight: normal;
    line-height: 1;
}

.calendar-cell.partial {
    background: #f39c12;
    color: #fff;
    border-color: #f39c12;
    font-weight: bold;
}

/* ==================== SELECTED DAYS LIST ==================== */

.selected-days-heading {
    color: var(--primary);
    margin-bottom: 8px;
}

.selected-days-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.selected-day-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.selected-day-date {
    font-weight: bold;
    color: var(--primary);
    min-width: 130px;
}

.selected-day-state {
    color: #7f8c8d;
    font-size: 0.85rem;
    flex: 1;
    min-width: 120px;
}

.selected-day-actions {
    display: flex;
    gap: 6px;
}

.day-action-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.day-action-btn:hover { background: #eef3f7; }

.day-action-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.day-action-btn.remove-btn {
    color: var(--danger);
    border-color: var(--danger);
    font-weight: bold;
}

.day-action-btn.remove-btn:hover { background: var(--danger); color: #fff; }

/* ==================== OVERVIEW CALENDAR ==================== */

.overview-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.overview-cell {
    cursor: default;
    flex-direction: column;
}

.overview-cell .cal-count {
    font-size: 0.65rem;
    font-weight: bold;
    line-height: 1;
}

.overview-cell.avail-green {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}

.overview-cell.avail-yellow {
    background: #f1c40f;
    color: #2c2c2c;
    border-color: #f1c40f;
}

.overview-cell.avail-red {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.day-details-expander {
    margin-top: 12px;
}

.day-details-expander summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--primary);
    padding: 8px 0;
    list-style: none;
}

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

.day-details-expander summary::before {
    content: "▶ ";
    font-size: 0.75em;
}

.day-details-expander[open] summary::before {
    content: "▼ ";
}

.day-details-expander summary:hover {
    color: var(--accent);
}

/* ==================== HOUR PICKER MODAL ==================== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-box h3 {
    margin-top: 0;
    color: var(--primary);
}

.modal-actions-top {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.small-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-top: 0;
}

.secondary-btn {
    background: #95a5a6;
}

.secondary-btn:hover { background: #7f8c8d; }

.hour-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.hour-btn {
    padding: 8px 4px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fafafa;
    text-align: center;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.hour-btn:hover { background: #eef3f7; }

.hour-btn.blocked {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    font-weight: bold;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
