/* =========================================================
   Fantasy Baseball Tracker — Dash App Stylesheet
   Goal: match Streamlit's clean, readable look
   ========================================================= */

/* --- Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #111827;
    background-color: #f9fafb;
    margin: 0;
    padding: 0;
}

/* --- App container --- */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.app-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
}

/* --- Login --- */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f9fafb;
}

.login-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #111827;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 320px;
}

.login-input {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    width: 100%;
}

.login-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.login-button {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background-color: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.login-button:hover {
    background-color: #1d4ed8;
}

.login-error {
    color: #dc2626;
    font-size: 13px;
    text-align: center;
}

/* --- Tabs --- */
.main-tabs {
    margin-bottom: 0;
    border-bottom: 2px solid #e5e7eb;
}

.main-tabs .tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    margin-bottom: -2px;
}

.main-tabs .tab--selected {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
    background: transparent;
}

.tab-content-wrapper {
    padding: 24px 0;
}

/* --- Tab content --- */
.tab-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

/* --- Banners --- */
.tbd-warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    color: #92400e;
}

.info-text {
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

.caption-text {
    color: #6b7280;
    font-size: 13px;
    margin: 4px 0;
}

/* --- Player Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    max-width: 800px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    /* Prevent overlay click from closing when clicking inside content */
    pointer-events: auto;
}

/* Stop clicks inside modal from bubbling to overlay */
.modal-overlay > .modal-content {
    pointer-events: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.modal-player-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.modal-player-meta {
    font-size: 14px;
    color: #6b7280;
    margin-top: 2px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #374151;
}

.modal-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.modal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-stat-box {
    background-color: #f3f4f6;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 68px;
    text-align: center;
}

.modal-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.modal-stat-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.modal-action-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.modal-action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.modal-action-primary {
    background-color: #2563eb;
    color: white;
}

.modal-action-primary:hover {
    background-color: #1d4ed8;
}

.modal-action-disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: default;
}

/* --- Clickable player names in tables --- */
.player-name-clickable {
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
}

.player-name-clickable:hover {
    text-decoration: underline;
}

/* --- Player Page --- */
.player-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.player-page-back {
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    margin-bottom: 16px;
    display: inline-block;
}

.player-page-back:hover {
    text-decoration: underline;
}

.player-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.player-page-section {
    margin-bottom: 32px;
}

.player-page-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}

.player-page-viz-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .player-page-viz-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        max-width: 98vw;
        padding: 16px;
    }
}
