/* static/css/team/team-design-system.css — Shared Team Design System
   Reusable primitives extracted from team_profile.css for all team pages.
   Provides glassmorphism cards, animations, stat cards, nav pills, and component bars.
*/

/* ═══════════════════════════════════════════
   Design Tokens
   ═══════════════════════════════════════════ */
.team-partial-wrapper,
.team-bento-page {
    --bento-gap: 16px;
    --bento-radius: 16px;
    --glass-blur: 12px;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.2);
    --reveal-duration: 0.6s;
    --ring-track: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .team-partial-wrapper,
[data-theme="dark"] .team-bento-page {
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --ring-track: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════
   Glassmorphism — .rc-glass
   ═══════════════════════════════════════════ */
.rc-glass {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--bento-radius);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-glass::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    pointer-events: none;
}

[data-theme="dark"] .rc-glass::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.rc-glass:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .rc-glass:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.rc-glass:focus-visible {
    outline: 2px solid var(--team-primary-color, #007bff);
    outline-offset: 2px;
}

@supports not (backdrop-filter: blur(12px)) {
    .rc-glass {
        background: var(--bg-primary);
    }
}

/* ═══════════════════════════════════════════
   Card Header
   ═══════════════════════════════════════════ */
.rc-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--team-primary-color, #007bff);
}

.rc-card__header i {
    color: var(--team-primary-color, #007bff);
}

/* ═══════════════════════════════════════════
   Section Title
   ═══════════════════════════════════════════ */
.rc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rc-section-title i {
    color: var(--team-primary-color, #007bff);
}

/* ═══════════════════════════════════════════
   Stat Cards
   ═══════════════════════════════════════════ */
.rc-stat-card {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .rc-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

.rc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rc-stat-card__icon {
    font-size: 1.3rem;
    color: var(--team-primary-color, #007bff);
    background: rgba(0, 123, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rc-stat-card__content {
    flex: 1;
    min-width: 0;
}

.rc-stat-card__value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.rc-stat-card__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.rc-stat-card__sublabel {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ═══════════════════════════════════════════
   Nav Pills
   ═══════════════════════════════════════════ */
.rc-nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0;
    margin-bottom: 4px;
}

.rc-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

[data-theme="dark"] .rc-nav-pill {
    background: rgba(255, 255, 255, 0.06);
}

.rc-nav-pill:hover {
    color: var(--team-primary-color, #10B981);
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    text-decoration: none;
}

[data-theme="dark"] .rc-nav-pill:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
}

.rc-nav-pill i {
    font-size: 0.7rem;
}

/* Active pill state */
.rc-nav-pill--active {
    color: var(--team-primary-color, #10B981);
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--team-primary-color, #10B981);
    font-weight: 700;
}

[data-theme="dark"] .rc-nav-pill--active {
    background: rgba(16, 185, 129, 0.18);
    border-color: var(--team-primary-color, #10B981);
}

/* ═══════════════════════════════════════════
   Component Bars (horizontal metric bars)
   ═══════════════════════════════════════════ */
.rc-component {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rc-component__label {
    font-size: 0.65rem;
    width: 72px;
    min-width: 72px;
    text-align: right;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-component__track {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--ring-track);
    overflow: hidden;
}

.rc-component__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-component__pct {
    font-size: 0.6rem;
    width: 20px;
    min-width: 20px;
    text-align: right;
    font-weight: 700;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   Shared Link Style
   ═══════════════════════════════════════════ */
.rc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--team-primary-color, #007bff);
    text-decoration: none;
}

.rc-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Scroll-Reveal Animations
   ═══════════════════════════════════════════ */
.rc-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--reveal-duration) cubic-bezier(0.4, 0, 0.2, 1),
                transform var(--reveal-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-reveal.rc-revealed {
    opacity: 1;
    transform: translateY(0);
}

.rc-stagger {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rc-stagger.rc-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
   Bento Table — Shared table styling inside glass cards
   ═══════════════════════════════════════════ */
.rc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rc-table th {
    background: var(--team-primary-color, #007bff);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

[data-theme="dark"] .rc-table td {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

.rc-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .rc-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rc-table tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════
   Bento Tab Pills — In-card filter tabs
   ═══════════════════════════════════════════ */
.rc-tab-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.rc-tab-pill {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

[data-theme="dark"] .rc-tab-pill {
    background: rgba(255, 255, 255, 0.06);
}

.rc-tab-pill:hover {
    background: rgba(0, 0, 0, 0.08);
}

.rc-tab-pill--active {
    color: #fff;
    background: var(--team-primary-color, #007bff);
    border-color: var(--team-primary-color, #007bff);
}

.rc-tab-pill .rc-tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-left: 4px;
}

/* ═══════════════════════════════════════════
   Star Ratings (inline)
   ═══════════════════════════════════════════ */
.rc-stars-inline {
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.rc-stars-inline--5 { color: #D97706; }
.rc-stars-inline--4 { color: #F59E0B; }
.rc-stars-inline--3 { color: #FBBF24; }
.rc-stars-inline--2 { color: #9CA3AF; }

/* ═══════════════════════════════════════════
   Direction Labels (incoming/outgoing)
   ═══════════════════════════════════════════ */
.rc-direction--in {
    color: #22C55E;
    font-weight: 600;
}

.rc-direction--out {
    color: #EF4444;
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   Stat Value Color Modifiers
   ═══════════════════════════════════════════ */
.rc-stat-card__value--positive { color: #22C55E; }
.rc-stat-card__value--negative { color: #EF4444; }
.rc-stat-card__value--neutral  { color: var(--text-secondary); }

/* ═══════════════════════════════════════════
   Chart Wrapper (inside glass cards)
   ═══════════════════════════════════════════ */
.rc-chart-wrap {
    height: 260px;
    position: relative;
}

/* ═══════════════════════════════════════════
   Compact Header (for partials inside browse shell)
   ═══════════════════════════════════════════ */
.team-partial__header {
    margin-bottom: 8px;
}

.team-partial__header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.team-partial__logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.team-partial__team-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.team-partial__conference {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.team-partial__header-accent {
    height: 3px;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════ */
.rc-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.rc-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.rc-empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════
   Reduced Motion
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .rc-reveal,
    .rc-stagger {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .rc-glass:hover {
        transform: none;
    }

    .rc-stat-card:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════
   Responsive — Tablet (<900px)
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .rc-tab-pills {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ═══════════════════════════════════════════
   Responsive — Mobile (<600px)
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
    .team-partial__header-inner {
        gap: 8px;
    }

    .team-partial__logo-img {
        width: 36px;
        height: 36px;
    }

    .team-partial__team-name {
        font-size: 1.15rem;
    }

    .rc-chart-wrap {
        height: 200px;
    }
}
