/* Player profile page styles */

/* Player stats overview cards */
.stat-card {
    transition: all 0.2s ease-in-out;
    background-color: var(--surface-1, #ffffff);
    border-color: var(--border-color, rgba(0, 0, 0, 0.125));
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-value {
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-primary, #2d3748);
}

/* Soft background colors that work in both light and dark modes */
.bg-soft-primary {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info, #3b82f6);
}

.bg-soft-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success, #10b981);
}

.bg-soft-purple {
    background-color: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
}

.bg-soft-indigo {
    background-color: rgba(102, 16, 242, 0.1);
    color: #6610f2;
}

.bg-soft-cyan {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.bg-soft-teal {
    background-color: rgba(32, 201, 151, 0.1);
    color: #20c997;
}

.stat-card a.card-body {
    color: inherit;
    text-decoration: none;
    background-color: var(--surface-1, #ffffff);
}

.stat-card a.card-body:hover {
    background-color: var(--surface-2, #f8f9fa);
}

/* Bag Tag Keychain Layout */
.bag-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    padding: 20px;
}

/* Keychain Card Styles */
.keychain-card,
.bag-tag-grid .card {
    background-color: var(--surface-1, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--border-color, rgba(0, 0, 0, 0.125));
    transition: all 0.3s ease;
    position: relative;
}

.keychain-card:hover,
.bag-tag-grid .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

/* Header Section */
.keychain-header {
    background-color: var(--surface-2, #f8f9fa);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
    height: 140px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.league-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    min-height: 2.4em;
    position: relative;
    z-index: 1;
}

/* Status Styles */
.tag-status-container {
    margin-top: auto;
    z-index: 1;
}

.tag-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 6px;
    transition: all 0.2s ease;
}

.tag-status i {
    font-size: 0.875rem;
}

.tag-status.permanent {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-status.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--info, #3b82f6);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.date-range {
    color: var(--text-muted, #718096);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* For special flipper width in exchanges view */
.bag-tag-exchanges .bag-tag-flipper {
    width: 320px;
}

/* Image Section */
.keychain-image {
    padding: 24px;
    background-color: var(--surface-1, #ffffff);
    min-height: 270.664px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Details Section */
.keychain-details {
    padding: 20px;
    background-color: var(--surface-1, #ffffff);
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
    position: relative;
    z-index: 1;
}

/* Stats Grid Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Stats Items */
.stat-item {
    padding: 12px;
    background-color: var(--surface-2, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
    transition: all 0.2s ease;
    position: relative;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted, #718096);
    margin-bottom: 4px;
    font-weight: 500;
}

/* Performance Stats Section */
.performance-stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Performance Items */
.performance-item {
    text-align: center;
    padding: 16px 12px;
    background-color: var(--surface-2, #f8f9fa);
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.performance-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, var(--info, #3b82f6), transparent);
    opacity: 0.1;
    transition: height 0.3s ease;
}

.performance-item:hover::before {
    height: 3px;
}

a.performance-item {
    cursor: pointer;
}

a.performance-item:hover {
    background-color: var(--surface-3, #e9ecef);
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    z-index: 1;
}

.performance-value {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary, #2d3748);
}

.performance-item .text-secondary {
    color: var(--text-primary, #2d3748) !important;
}

.performance-label {
    font-size: 0.75rem;
    color: var(--text-muted, #718096);
    margin-bottom: 8px;
}

.performance-context {
    font-size: 0.7rem;
    color: var(--text-muted, #718096);
    line-height: 1.2;
}

/* Register button */
.register-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 12px 16px;
    background-color: var(--info, #3b82f6);
    color: white !important;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    gap: 12px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.register-button:hover {
    background-color: var(--info-hover, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    color: white !important;
    text-decoration: none;
}

.register-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition-duration: 0.1s;
}

.register-button i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.register-button:hover i {
    transform: translateX(-2px);
}

/* Achievements Section */
.achievements-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
    position: relative;
}

.achievements-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
    margin-bottom: 12px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* Achievement Items */
.achievement-item {
    padding: 16px 12px;
    background-color: var(--surface-2, #f8f9fa);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.achievement-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, var(--info, #3b82f6), transparent);
    opacity: 0.1;
    transition: height 0.3s ease;
}

.achievement-item:hover {
    transform: translateY(-4px);
    background-color: var(--surface-3, #e9ecef);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    z-index: 1;
}

.achievement-item:hover::before {
    height: 3px;
}

.achievement-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    color: var(--info, #3b82f6);
}

.achievement-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #2d3748);
    margin-bottom: 4px;
}

.achievement-date {
    font-size: 0.75rem;
    color: var(--text-muted, #718096);
    margin-bottom: 4px;
}

.achievement-context {
    font-size: 0.7rem;
    color: var(--text-muted, #718096);
    line-height: 1.2;
}

/* Empty Achievements State */
.achievements-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: var(--surface-2, #f8f9fa);
    border-radius: 8px;
    border: 1px dashed var(--border-color, rgba(0, 0, 0, 0.125));
    margin-top: 16px;
    text-align: center;
}

.achievements-empty-icon {
    color: var(--text-muted, #718096);
    font-size: 24px;
    margin-bottom: 12px;
}

.achievements-empty-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #2d3748);
    margin-bottom: 4px;
}

.achievements-empty-text {
    font-size: 0.75rem;
    color: var(--text-muted, #718096);
    line-height: 1.4;
}

/* Empty State Message */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background-color: var(--surface-2, #f8f9fa);
    border-radius: 16px;
    margin: 30px auto;
    border: 1px dashed var(--border-color, rgba(0, 0, 0, 0.125));
    max-width: 500px;
}

.empty-state h3 {
    color: var(--text-primary, #2d3748);
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted, #718096);
    font-size: 1rem;
    line-height: 1.6;
}

/* Section Headers */
h2.fw-bold, h2.h3, h2.text-2xl {
    color: var(--text-primary, #2d3748);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Accessibility Focus Styles */
.keychain-card:focus-within,
.bag-tag-grid .card:focus-within {
    outline: 2px solid var(--info, #3b82f6);
    outline-offset: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.achievement-item:focus,
.performance-item:focus {
    outline: 2px solid var(--info, #3b82f6);
    outline-offset: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bag-tag-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .keychain-card,
    .bag-tag-grid .card {
        margin-bottom: 16px;
    }

    .keychain-card:hover,
    .bag-tag-grid .card:hover {
        transform: translateY(-4px);
    }

    .performance-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .achievement-item:hover {
        transform: translateY(-2px);
    }

    h2.fw-bold, h2.h3, h2.text-2xl {
        font-size: 1.25rem;
    }
}

/* Reduced motion considerations */
@media (prefers-reduced-motion: reduce) {
    .keychain-card,
    .bag-tag-grid .card,
    .achievement-item,
    .performance-item,
    .stat-item,
    .register-button,
    .tag-status {
        transition-duration: 0.1s !important;
    }

    .keychain-card:hover,
    .bag-tag-grid .card:hover {
        transform: translateY(-2px);
    }

    .achievement-item:hover {
        transform: translateY(-1px);
    }
}

/* =====================================================
   Stats Mode Badge & Modal
   ===================================================== */

/* Stats Mode Badge - shown in profile identity meta */
.stats-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.stats-mode-badge i {
    font-size: 0.75rem;
}

/* Active variant - player has throw data */
.stats-mode-badge--active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    color: var(--success, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stats-mode-badge--active:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.15));
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

/* Promo variant - player doesn't have throw data */
.stats-mode-badge--promo {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
    color: var(--info, #3b82f6);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.stats-mode-badge--promo:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.15));
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

/* Stats Mode Modal Styles */
.stats-mode-modal .modal-content {
    background-color: var(--surface-1, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.125));
}

.stats-mode-modal__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    padding: 1rem 1.25rem;
}

.stats-mode-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--info, #3b82f6), #6366f1);
    color: #fff;
    font-size: 1rem;
}

.stats-mode-modal .modal-title {
    flex: 1;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
}

.stats-mode-modal .modal-body {
    padding: 1.25rem;
}

.stats-mode-modal__screenshot {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-mode-modal__intro {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-secondary, #4a5568);
    margin-bottom: 1rem;
}

.stats-mode-modal__celebration {
    text-align: center;
    margin-bottom: 1rem;
}

.stats-mode-modal__benefits {
    background-color: var(--surface-2, #f8f9fa);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.stats-mode-modal__benefits-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
    margin-bottom: 0.75rem;
}

.stats-mode-modal__benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-mode-modal__benefits-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #4a5568);
}

.stats-mode-modal__benefits-list li i {
    color: var(--success, #10b981);
    font-size: 0.875rem;
}

.stats-mode-modal__cta-text {
    font-size: 0.875rem;
    color: var(--text-muted, #718096);
    text-align: center;
    margin-bottom: 0;
}

.stats-mode-modal .modal-footer {
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    padding: 1rem 1.25rem;
}

/* Dark mode adjustments */
.dark-theme .stats-mode-modal__benefits {
    background-color: var(--surface-2, rgba(255, 255, 255, 0.05));
}

.dark-theme .stats-mode-modal__screenshot {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .stats-mode-badge__text {
        display: none;
    }

    .stats-mode-badge {
        padding: 0.375rem;
    }

    .stats-mode-badge i {
        font-size: 0.875rem;
    }
}