/**
 * AI COACHES PRO - ESPN INTEGRATED STYLES
 * Modern, professional styling for the complete coaching system
 */

/* ================================
   CONTAINER & LAYOUT
   ================================ */

.ai-coaches-pro-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ================================
   HEADER SECTION
   ================================ */

.coaches-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.header-content h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.user-stats-header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.coin-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid var(--primary);
    font-weight: 700;
    font-size: 18px;
}

.coin-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.coin-icon-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.tier-badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.tier-free {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tier-badge.tier-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tier-badge.tier-vip {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* ================================
   FILTERS
   ================================ */

.coaches-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ================================
   COACHES GRID
   ================================ */

.coaches-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

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

/* ================================
   COACH CARD
   ================================ */

.coach-card-pro {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coach-card-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.coach-card-pro.hired {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.hired-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--success);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
}

.subscription-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
}

/* ================================
   AVATAR & RANK
   ================================ */

.coach-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.coach-avatar-pro {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.rank-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.rank-icon {
    font-size: 14px;
}

.rank-name {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   COACH INFO
   ================================ */

.coach-info-pro {
    text-align: center;
    margin-bottom: 20px;
}

.coach-info-pro h3 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
}

.specialty-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.sport-tag {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coach-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 12px 0;
}

/* ================================
   STATS GRID
   ================================ */

.coach-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.stat-good {
    color: var(--success);
}

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

.stat-value.stat-neutral {
    color: var(--text-secondary);
}

.coach-style {
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.coach-style i {
    color: var(--primary);
    margin-right: 6px;
}

/* ================================
   COACH ACTIONS
   ================================ */

.coach-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

.hired-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expires-info {
    text-align: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.expires-info i {
    color: var(--warning);
    margin-right: 6px;
}

.btn-view-picks {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-picks:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Cannot Hire */
.cannot-hire {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hire-error {
    text-align: center;
    color: var(--error);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.hire-error i {
    margin-right: 6px;
}

.btn-upgrade {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-disabled {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Hire Options */
.hire-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hire-cost {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
}

.hire-periods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-hire-period {
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-hire-period:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-hire-period:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================
   PICKS MODAL
   ================================ */

.coach-picks-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content-pro {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

/* ================================
   PREDICTION CARD
   ================================ */

.prediction-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.prediction-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prediction-header {
    margin-bottom: 16px;
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.game-matchup .team {
    font-size: 16px;
    font-weight: 700;
}

.game-matchup .vs {
    color: var(--text-secondary);
    font-size: 14px;
}

.game-time {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.prediction-pick {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.pick-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pick-team {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.pick-spread {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Confidence Bar */
.confidence-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.confidence-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.confidence-track {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.confidence-value {
    font-size: 14px;
    font-weight: 700;
}

/* Reasoning */
.prediction-reasoning {
    margin-bottom: 16px;
}

.reasoning-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.prediction-reasoning ul {
    margin: 0;
    padding-left: 20px;
}

.prediction-reasoning li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.prediction-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ai-model-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ================================
   LOADING & ERROR STATES
   ================================ */

.loading-coaches,
.loading-picks,
.no-picks,
.error-picks,
.error-state {
    text-align: center;
    padding: 60px 24px;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-picks i,
.error-picks i,
.error-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.no-picks p,
.error-picks p,
.error-state p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 8px 0;
}

.no-picks small {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-retry {
    margin-top: 16px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10002;
    transition: bottom 0.3s ease;
    border: 2px solid var(--border-color);
}

.toast.show {
    bottom: 24px;
}

.toast.toast-success {
    border-color: var(--success);
}

.toast.toast-success i {
    color: var(--success);
}

.toast.toast-error {
    border-color: var(--error);
}

.toast.toast-error i {
    color: var(--error);
}

.toast.toast-info {
    border-color: var(--primary);
}

.toast.toast-info i {
    color: var(--primary);
}

.toast i {
    font-size: 20px;
}

.toast span {
    font-weight: 600;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .ai-coaches-pro-container {
        padding: 16px;
    }

    .coaches-header-pro {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header-content h2 {
        font-size: 24px;
    }

    .user-stats-header {
        width: 100%;
        justify-content: center;
    }

    .coaches-filters {
        gap: 8px;
    }

    .filter-btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .coach-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .hire-periods {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content-pro {
        width: 95%;
        max-height: 90vh;
    }

    .game-matchup .team {
        font-size: 14px;
    }

    .pick-team {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .coin-balance {
        font-size: 16px;
        padding: 10px 16px;
    }

    .coin-icon {
        width: 24px;
        height: 24px;
    }

    .coach-avatar-container {
        width: 100px;
        height: 100px;
    }

    .coach-info-pro h3 {
        font-size: 20px;
    }

    .stat-value {
        font-size: 16px;
    }
}

/* ================================
   DARK MODE SUPPORT
   ================================ */

@media (prefers-color-scheme: dark) {
    .coach-card-pro {
        background: var(--bg-secondary);
    }

    .modal-content-pro {
        background: var(--bg-secondary);
    }

    .prediction-card {
        background: var(--bg-tertiary);
    }
}