/* stats-mastery.css */

/* Stats Rows */
.m-stat-row {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}


.m-stat-label-container {
    display: flex;
    align-items: center;
    color: #fff !important;
    min-width: 0;
}

.m-stat-label {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--color-text);
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
    text-transform: uppercase;
    white-space: nowrap;
}

.m-stat-value {
    font-size: 1.6em;
    font-weight: bold;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .m-stat-value {
        font-size: 1.1em;
    }
}

.m-stat-value.stat-light-green {
    color: rgb(71, 224, 81);
}

.m-stat-value.stat-orange {
    color: rgb(247, 142, 100);
}

.m-stat-value.stat-yellow {
    color: var(--color-warning);
}

.m-stat-value.stat-green {
    color: rgb(1, 160, 1);
}

/* Stats Section */
.m-stats-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.m-stats-wrapper {
    display: flex;
    gap: 5px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.m-stats-card {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    width: 100%;
    color: var(--color-text);
    box-sizing: border-box;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .m-stats-card {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .m-stats-card {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

/* Detailed Stats */
.m-detailed-stats-section {
    background: var(--color-background);
    padding: 20px;
}

.m-detailed-stats-section h3 {
    margin: 0 0 20px 0;
    text-align: left;
    color: var(--color-text);
    font-size: 1.5em;
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
    text-transform: uppercase;
    padding-left: 15px;
}

.m-detailed-stats-grid {
    columns: 2;
    column-gap: 20px;
    width: 100%;
}

.m-stat-category {
    break-inside: avoid;
    margin-bottom: 20px;
    width: 100%;
    display: inline-block;
}

.m-stat-category h4 {
    color: var(--color-text);
    font-size: 1.2em;
    margin: 0 0 10px 0;
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
    text-transform: uppercase;
    padding-left: 5px;
}

.m-detailed-stat-row {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
    background: var(--color-surface);
    margin-bottom: 3px;
}

.m-stat-text-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.m-detailed-stat-name {
    color: var(--color-text);
    font-size: 0.7em;
}

.m-detailed-stat-value {
    color: var(--color-text);
    font-size: 0.9em;
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-detailed-stat-value .upgrade-container {
    display: inline-block;
}

.m-detailed-stat-value .current-value {
    font-weight: 600;
    padding: 4px 8px !important;
    font-family: var(--wp--preset--font-family--manrope);
    font-size: 0.8em;
}

.m-detailed-stat-value .base-value {
    color: var(--color-text);
}

.m-stat-meter {
    position: relative;
    height: 4px;
    background: var(--color-border);
    overflow: hidden;
    margin-top: 4px;
}

.m-meter-fill {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background: var(--color-text);
    transition: width 0.3s ease;
}

/* Base stat styling */
.m-meter-fill.base-stat {
    background: var(--color-text);
    z-index: 1;
}

/* Upgrade text styling */
.m-stat-upgrade {
    color: var(--color-success);
    font-weight: 600;
}

/* Goalkeeper Stats Styling */
.m-gk-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
    width: 100%;
    background: var(--color-background);
}

/* Match the outfield player stat boxes */
.m-gk-stats-grid .stat-row {
    background: var(--color-surface);
    border-radius: 0px;
    padding: 10px 35px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-width: 0px;
}

.m-gk-stats-grid .stat-label {
    font-size: 1em;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: -10px;
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
    text-transform: uppercase;
}

.m-gk-stats-grid .stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--color-text);
}

/* Goalkeeper Detailed Stats Section */
.m-gk-detailed-stats {
    padding: 20px;
    background: var(--color-surface);
}

.m-gk-detailed-stats .stat-category {
    margin-bottom: 20px;
}

.m-gk-detailed-stats .stat-category h4 {
    color: var(--color-text);
    font-size: 1.2em;
    margin: 0 0 10px 0;
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
    text-transform: uppercase;
    padding-left: 5px;
}

.m-gk-detailed-stats .detailed-stat-row {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
    background: var(--color-background);
    margin-bottom: 3px;
}

.m-gk-detailed-stats .stat-text-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.m-gk-detailed-stats .detailed-stat-name {
    color: var(--color-text);
    font-size: 0.7em;
}

.m-gk-detailed-stats .detailed-stat-value {
    color: var(--color-text);
    font-size: 0.9em;
    font-family: var(--wp--preset--font-family--big-shoulders-display) !important;
}

/* Responsive Styles */
@media (max-width: 768px) {

    .m-stat-row {
        padding: 8px !important;
        background: var(--color-surface);
        justify-content: space-around;
    }

    .m-player-stats {
        margin: 15px 20px 10px 20px;
    }

    .m-other-versions {
        margin: 15px 20px 10px 20px;
    }
    .m-player-actions-section {
        margin-bottom:0px !important;
        border-bottom: 1px solid var(--color-border);
    }

    .m-gk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .m-gk-stats-grid .stat-row {
        padding: 10px 20px;
    }

    .m-gk-detailed-stats .detailed-stat-name {
        font-size: 0.9em !important;
    }

    .m-gk-stats-grid .stat-value {
        font-size: 1.2em;
    }

    .m-detailed-stats-grid {
        columns: 1;
    }

    .m-stat-category {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        break-inside: avoid;
        margin-bottom: 20px;
    }

    /* Single stat categories */
    .m-stat-category.single-stat .detailed-stat-row {
        grid-column: 1 / -1;
    }

    .m-stat-category h4 {
        grid-column: 1 / -1;
        margin-bottom: 10px;
    }

    .m-detailed-stat-row {
        min-width: 0;
        font-size: 0.9em;
    }

    .m-stat-meter {
        min-width: 60px;
    }

    .m-stat-text-container {
        min-width: 0;
        flex-wrap: wrap;
        gap: 4px;
    }

    .m-detailed-stat-name {
        white-space: normal;
        line-height: 1.2;
        flex: 1;
        font-size: 0.8em;
    }

    .m-detailed-stat-value {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .m-detailed-stat-row {
        min-width: 0;
        font-size: 0.9em;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .m-gk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .m-gk-stats-grid .stat-row {
        min-width: calc(30% - 1px) !important;
    }
}

/* Color coding for stat values - matching outfield players */
.m-gk-stats-grid .stat-value.stat-orange {
    color: rgb(247, 142, 100);
}

.m-gk-stats-grid .stat-value.stat-yellow {
    color: var(--color-warning);
}

.m-gk-stats-grid .stat-value.stat-light-green {
    color: rgb(71, 224, 81);
}

.m-gk-stats-grid .stat-value.stat-green {
    color: var(--color-success);
}

/* Player Actions Section */
.m-player-actions-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--color-surface);
}

.m-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.m-scout-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.m-action-button {
    padding: 0.75rem 1rem;
    border: none;
    font-weight: 600;
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-bottom-width: 3px !important;
    color: var(--color-text);
    font-size: 1.2rem;
    cursor: pointer;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--wp--preset--font-family--big-shoulders-display);
    text-transform: uppercase;
    min-width: 0;
}

.m-submit-level-btn {
    text-decoration: none;
}

.m-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--color-border);
}

.m-bookmark-button {
    color: var(--color-text);
    border-color: var(--color-warning);
}

.m-ss-report-trigger {
    color: var(--color-text);
}

.m-action-button[href*="compare"] {
    color: var(--color-text);
    text-decoration: none;
    border-color: var(--color-success);
}

.m-action-button.scout-action {
    border: 1px solid var(--color-text);
    color: var(--color-text);
}

@media (max-width: 768px) {
    .m-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .m-stat-entry,
    .m-detail-entry {
        flex-direction: column;
    }
}

/* Stat value colors */
.m-current-value.stat-red,
.m-stat-value.stat-red {
    background: var(--color-primary);
    padding:0px 10px;
    border-radius: 4px;
    color: #fff;
    text-shadow: 1px 1px 2px #000000ba;
}

.m-current-value.stat-yellow,
.m-stat-value.stat-yellow {
    background: var(--color-warning);
    padding:0px 10px;
    border-radius: 4px;
    color: #fff;
    text-shadow: 1px 1px 2px #000000ba;
}

.m-current-value.stat-green,
.m-stat-value.stat-green {
    background: var(--color-success);
    padding:0px 10px;
    border-radius: 4px;
    color: #fff;
    text-shadow: 1px 1px 2px #000000ba;
}

.m-current-value.stat-ultra,
.m-stat-value.stat-ultra {
    background: #009207; /* Darker green */
    padding:0px 10px;
    border-radius: 4px;
    color: #fff;
    text-shadow: 1px 1px 2px #000000ba;
}

/* Meter bar colors */
.m-meter-fill.stat-red {
    background-color: var(--color-primary);
}

.m-meter-fill.stat-yellow {
    background-color: var(--color-warning);
}

.m-meter-fill.stat-green {
    background-color: var(--color-success);
}

.m-meter-fill.stat-ultra {
    background-color: var(--color-ultra);
}

/* Base stat meters should be fully opaque */
.m-meter-fill.base-stat {
    opacity: 1;
}

/* Meter bar colors */
.m-meter-fill.stat-ultra {
    background-color: #009207; /* Darker green */
}
