/* MWFA Masters Design System & UI Consistency (Issues #48, #49, #50) */

:root {
    --link-color: #1565c0;
    --link-hover: #0d47a1;
    --tap-min: 44px;
}

body.dark-theme {
    --link-color: #64b5f6;
    --link-hover: #90caf9;
}

/* Global button text transform override */
button, .btn, .btn-flat {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Standardized Button Sizing Ladder */
.btn-l {
    height: 48px !important;
    line-height: 48px !important;
    padding: 0 28px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
}

.btn-m {
    height: 42px !important;
    line-height: 42px !important;
    padding: 0 20px !important;
    font-size: 1.0rem !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
}

.btn-s {
    height: 36px !important;
    line-height: 34px !important;
    padding: 0 14px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    border-radius: 18px !important;
    position: relative;
}

/* Ensure 44px minimum touch hit area for small buttons without distorting visual layout */
.btn-s::after {
    content: "";
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: -4px;
    right: -4px;
}

/* Standardized Touch-Target Links (44px min hit box) */
.touch-link {
    color: var(--link-color) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-min);
    min-width: var(--tap-min);
    padding: 4px 10px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s, color 0.15s;
    box-sizing: border-box;
}

.touch-link:hover, .touch-link:active {
    background-color: rgba(21, 101, 192, 0.08);
}

body.dark-theme .touch-link:hover, body.dark-theme .touch-link:active {
    background-color: rgba(100, 181, 246, 0.12);
}

/* Accessible Close and Cancel link styles */
.close-action-link {
    color: var(--link-color) !important;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-min);
    min-width: var(--tap-min);
    padding: 4px 10px;
    border-radius: 8px;
    box-sizing: border-box;
}

.close-action-link:hover, .close-action-link:active {
    background-color: rgba(21, 101, 192, 0.08);
}

body.dark-theme .close-action-link:hover, body.dark-theme .close-action-link:active {
    background-color: rgba(100, 181, 246, 0.12);
}

/* Hardware-Accelerated Chevron Rotation */
.chevron-rotate {
    transition: transform 0.2s ease;
    display: inline-block;
}

.expanded .chevron-rotate,
.chevron-rotate.rotate-180 {
    transform: rotate(180deg);
}

/* Standardized Type Scale Utilities */
.modal-title-std {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1976d2;
    margin: 0;
}

/* Universal Modal Styling & Dark Theme Consistency (Issue #85) */
.modal {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

.modal .modal-content {
    color: var(--text-main);
}

.modal .modal-footer {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

body.dark-theme .modal {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .modal .modal-content {
    color: var(--text-main);
}

body.dark-theme .modal .modal-footer {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border-top: 1px solid var(--border-color);
}

body.dark-theme .modal-title-std,
body.dark-theme #score_modal_title,
body.dark-theme #season_results_modal_title {
    color: #64b5f6 !important;
}

.badge-floor {
    font-size: 0.80rem !important;
}

/* PWA Install Promotion Banner & Adoption Funnel (Issue #60) */
.pwa-install-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 520px;
    z-index: 996;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
    padding: 12px 14px;
    display: none;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    animation: pwaBannerFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaBannerFadeUp {
    from {
        transform: translate(-50%, 30px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pwa-install-body {
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 2px 0;
    line-height: 1.25;
}

.pwa-install-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.25;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    min-width: 36px;
    min-height: 36px;
    transition: background-color 0.15s ease;
}

.pwa-install-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

body.dark-theme .pwa-install-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

/* iOS Install Step Item */
.ios-install-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ios-install-step-num {
    background: rgba(25, 118, 210, 0.12);
    color: #1976d2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

body.dark-theme .ios-install-step-num {
    background: rgba(100, 181, 246, 0.2);
    color: #64b5f6;
}

/* Clean Form Input Styles & Focus Transitions */
.input-clean {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    height: 44px !important;
    width: 100% !important;
    font-size: 1rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.input-clean:focus {
    border-color: #1976d2 !important;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2) !important;
    outline: none !important;
}

body.dark-theme .input-clean:focus {
    border-color: #64b5f6 !important;
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.25) !important;
}

/* Season Results Consolidated Card & Tabular Layout (Issue #63) */
.season-results-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
}

.season-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
    min-height: 48px;
    box-sizing: border-box;
    gap: 8px;
}

.season-result-row:last-child {
    border-bottom: none;
}

.season-result-row:hover {
    background-color: rgba(25, 118, 210, 0.04);
}

.season-result-row:active {
    background-color: rgba(25, 118, 210, 0.09);
}

body.dark-theme .season-result-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .season-result-row:active {
    background-color: rgba(255, 255, 255, 0.08);
}

.season-result-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.season-result-date {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    width: 52px;
    flex-shrink: 0;
    letter-spacing: -0.2px;
}

.season-status-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 800;
    flex-shrink: 0;
    line-height: 1;
}

.season-status-badge.badge-w {
    background-color: rgba(16, 185, 129, 0.18);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

body.dark-theme .season-status-badge.badge-w {
    background-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.season-status-badge.badge-d {
    background-color: rgba(245, 158, 11, 0.18);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

body.dark-theme .season-status-badge.badge-d {
    background-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.season-status-badge.badge-l {
    background-color: rgba(239, 68, 68, 0.18);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

body.dark-theme .season-status-badge.badge-l {
    background-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.season-status-badge.badge-none {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
}

.season-result-match {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
}

.season-team-code {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    width: 48px;
    flex-shrink: 0;
}

.season-team-code.code-home {
    text-align: right;
    color: var(--text-main);
}

.season-team-code.code-away {
    text-align: left;
    color: var(--text-main);
}

.season-score-num {
    font-size: 1.18rem;
    font-weight: 800;
    min-width: 44px;
    text-align: center;
    color: var(--text-main);
    flex-shrink: 0;
    letter-spacing: 1px;
}

.season-score-unplayed {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
    flex-shrink: 0;
}

.season-result-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    color: var(--text-muted);
}

.season-result-action i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.season-result-row:active .season-result-action i {
    transform: translateX(2px);
}

.score-stepper-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    transition: background-color 0.15s, transform 0.08s;
}

.score-stepper-btn:active {
    transform: scale(0.92);
    background-color: rgba(25, 118, 210, 0.1);
}

/* Season Stats Breakdown Rows (Issue #63 Iteration 2) */
.season-stats-bar-tapable {
    transition: background-color 0.15s ease;
}

.season-stats-bar-tapable:active {
    background-color: rgba(25, 118, 210, 0.08) !important;
}

.stats-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.stats-breakdown-row:last-child {
    border-bottom: none;
}

.stats-bd-num {
    font-size: 1.15rem;
    font-weight: 800;
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
}

@media (max-width: 360px) {
    .season-result-row {
        padding: 8px 10px;
        gap: 6px;
    }
    .season-result-date {
        font-size: 0.85rem;
        width: 46px;
    }
    .season-status-badge {
        width: 22px;
        height: 22px;
        font-size: 0.78rem;
    }
    .season-team-code {
        font-size: 0.95rem;
        width: 40px;
    }
    .season-score-num {
        font-size: 1.05rem;
        min-width: 36px;
    }
}

