/* /css/trophy-case.css */

/* Page-specific styles for trophy-case.html */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.award-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.award-card h3 {
    color: #0056b3;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    transition: color 0.3s;
}

.award-winner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.winner-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    transition: border-color 0.3s;
}

.winner-info {
    text-align: left;
}

.winner-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.winner-name a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.winner-name a:hover {
    color: #007bff;
    text-decoration: underline;
}

.winner-detail {
    font-size: 0.9rem;
    color: #666;
    transition: color 0.3s;
}

.winner-detail a {
    color: #666;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.winner-detail a:hover {
    text-decoration: underline;
}

.winner-detail .detail-positive {
    font-weight: bold;
    color: #28a745;
}

.winner-stats {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    transition: border-color 0.3s;
}

.winner-stats a,
.winner-stats span {
    color: #28a745;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    white-space: nowrap;
}

.winner-stats a:hover {
    color: #155724;
    text-decoration: underline;
}

/* Style for negative stats, like LVP */
.winner-stats .detail-negative {
    color: #d9534f;
    /* Readable red color */
}

.all-stars-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.all-star-team {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.all-star-header {
    background-color: #333;
    color: white;
    padding: 1rem;
    text-align: center;
}

.all-star-header h3 {
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
}

.all-star-header .header-icon {
    height: 48px;
    width: 48px;
}

.all-star-list-header {
    display: grid;
    grid-template-columns: auto 1fr 65px 65px 65px;
    /* Icon, Player, REL, WAR, GEM */
    gap: 1rem;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
    font-size: 0.9rem;
    color: #666;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.all-star-list-header .player-col-header {
    text-align: left;
    grid-column: 2;
}

.all-star-list-header .stat-col-header {
    text-align: center;
}

.all-star-list {
    list-style: none;
    padding: 0;
}

.all-star-item {
    display: grid;
    grid-template-columns: auto 1fr 65px 65px 65px;
    /* Icon, Player, REL, WAR, GEM */
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s, border-color 0.3s;
}

.all-star-item:hover {
    background-color: #f8f9fa;
}

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

.all-star-player-info {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex item from overflowing grid cell */
}

.all-star-player-info a {
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
}

.all-star-player-info a:hover {
    text-decoration: underline;
}

.player-name-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.all-star-player-info a > .rookie-badge,
.all-star-player-info a > .all-star-badge {
    flex-shrink: 0;
}

.all-star-stats {
    font-size: 0.85rem;
    color: #666;
    transition: color 0.3s;
}

.all-star-stat {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Dark Mode Styles */
.dark-mode .award-card,
.dark-mode .all-star-team {
    background-color: #1e1e1e;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.dark-mode .award-card h3 {
    color: #8ab4f8;
}

.dark-mode .winner-logo {
    border-color: #444;
}

.dark-mode .winner-name a {
    color: #e0e0e0;
}

.dark-mode .winner-name a:hover {
    color: #8ab4f8;
}

.dark-mode .winner-detail,
.dark-mode .winner-detail a {
    color: #aaa;
}

.dark-mode .winner-stats {
    border-top-color: #333;
}

.dark-mode .winner-stats a,
.dark-mode .winner-stats span {
    color: #66bb6a;
}

.dark-mode .winner-stats a:hover {
    color: #81c784;
}

.dark-mode .winner-stats .detail-negative {
    color: #f87171;
}

.dark-mode .all-star-list-header {
    background-color: #2c2c2c;
    border-bottom-color: #444;
    color: #bbb;
}

.dark-mode .all-star-item {
    border-bottom-color: #333;
}

.dark-mode .all-star-item:hover {
    background-color: #2c2c2c;
}

.dark-mode .all-star-player-info a {
    color: #8ab4f8;
}

.dark-mode .all-star-stats {
    color: #aaa;
}

@media (max-width: 768px) {
    .all-stars-container {
        grid-template-columns: 1fr;
    }
    .all-star-list-header, .all-star-item {
        /* UPDATED: Increased stat column width to prevent header wrapping */
        grid-template-columns: auto 1fr 70px; /* Icon | Player | REL */
        font-size: 0.9rem;
    }
    .all-star-list-header .stat-col-header, .all-star-stat {
        text-align: right;
    }
    /* CORRECTED: Hides WAR and GEM columns, leaving REL Med visible */
    .all-star-list-header > span:nth-of-type(n+3),
    .all-star-item > div:nth-of-type(n+3) {
        display: none;
    }
}

/* ==================================================
 Modal Styles
==================================================
*/
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    overflow-y: auto
}

.modal-content {
    background-color: #fff;
    margin: 2rem auto;
    border-radius: 8px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    transition: background-color .3s
}

.modal-header {
    background-color: #333;
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.4rem
}

.close-btn {
    background: 0 0;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: .5rem;
    border-radius: 4px;
    transition: background-color .3s
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, .1)
}

.modal-body {
    padding: 2rem
}

.game-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem
}

.team-breakdown {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    transition: background-color .3s, border-color .3s
}

.team-breakdown.winner {
    border-color: #28a745;
    border-width: 2px
}

.modal-team-header {
    background-color: #333;
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: background-color .3s;
    cursor: pointer
}

.modal-team-info-wrapper {
    display: inline-flex;
    align-items: center;
    gap: .75rem
}

.modal-team-header.winner {
    background-color: #28a745
}

.modal-team-header h4 {
    color: #fff;
    margin: 0;
    font-size: 1.3rem
}

.modal-team-record {
    font-size: 1rem;
    opacity: .8
}

.modal-team-header .team-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px
}

.team-total {
    background-color: #e9ecef;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 2px solid #ddd;
    transition: background-color .3s, border-color .3s;
    display: flex;
    align-items: center;
    justify-content: center
}

.lineup-table {
    width: 100%;
    border-collapse: collapse
}

.lineup-table th {
    background-color: #f8f9fa;
    padding: .8rem .5rem;
    text-align: center;
    font-weight: 700;
    border-bottom: 2px solid #ddd;
    font-size: .9rem;
    transition: background-color .3s, border-color .3s
}

.lineup-table th:first-child {
    text-align: left;
    width: 50%
}

.lineup-table th:nth-child(2),
.lineup-table th:nth-child(3) {
    width: 25%
}

.lineup-table td {
    padding: .8rem .5rem;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
    text-align: center;
    transition: border-color .3s
}

.lineup-table td:first-child {
    text-align: left
}

.lineup-table tr:hover {
    background-color: #fff
}

.captain-row {
    background-color: #fff3cd!important;
    font-weight: 700
}

.captain-badge {
    background-color: #ffc107;
    color: #333;
    padding: .2rem .5rem;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 700;
    margin-left: .5rem
}

.captain-bonus {
    font-size: .75rem;
    color: #ffc107;
    font-weight: 500;
    margin-top: .2rem
}

.player-name-cell {
    font-weight: 500
}

.player-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color .3s ease
}

.player-link:hover {
    color: #0056b3;
    text-decoration: underline
}

.points-cell {
    text-align: center;
    font-weight: 700
}

.rank-cell {
    text-align: center;
    color: #666
}

.live-indicator-modal {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
    animation: pulse-live 1.5s infinite
}

@keyframes pulse-live {
    0% {
        opacity: 1
    }
    50% {
        opacity: .4
    }
    100% {
        opacity: 1
    }
}

.dark-mode .modal-content {
    background-color: #1e1e1e
}

.dark-mode .close-btn:hover {
    background-color: rgba(255, 255, 255, .2)
}

.dark-mode .team-breakdown {
    background-color: #2c2c2c;
    border-color: #444
}

.dark-mode .team-breakdown.winner {
    border-color: #66bb6a
}

.dark-mode .modal-team-header.winner {
    background-color: #2e7d32
}

.dark-mode .team-total {
    background-color: #3a3a3a;
    border-top: 1px solid #4f4f4f;
    border-bottom: 2px solid #4f4f4f
}

.dark-mode .lineup-table th {
    background-color: #2c2c2c;
    border-bottom-color: #444
}

.dark-mode .lineup-table td {
    border-color: #333
}

.dark-mode .lineup-table tr:hover {
    background-color: #383838
}

.dark-mode .captain-row {
    background-color: #4a4100!important
}

.dark-mode .captain-badge {
    background-color: #ffe082;
    color: #121212
}

.dark-mode .player-link {
    color: #8ab4f8
}

.dark-mode .player-link:hover {
    color: #a7c7fa
}

.dark-mode .rank-cell {
    color: #aaa
}

@media (max-width:768px) {
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem)
    }
    .game-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem
    }
    .modal-body {
        padding: 1rem
    }
    .lineup-table th,
    .lineup-table td {
        padding: .5rem .3rem;
        font-size: .8rem
    }
    .modal-team-header .team-logo {
        width: 36px;
        height: 36px
    }
    .modal-header {
        padding: 1rem
    }
    .modal-header h3 {
        font-size: 1.1rem;
        line-height: 1.3;
        word-break: break-word;
        hyphens: auto
    }
}

@media (max-width:480px) {
    .modal-header {
        padding: .8rem
    }
    .modal-header h3 {
        font-size: 1rem;
        line-height: 1.2
    }
}