/* Modern Team Page Styles */
:root {
    --team-primary: #6C00FF;
    --team-secondary: #FF4500;
    --team-primary-rgb: 108, 0, 255;
    --team-secondary-rgb: 255, 69, 0;
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--team-primary), var(--team-secondary));
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Navbar override to ensure full width on team pages */
.navbar-desktop {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 20px !important;
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.team-content {
    min-height: 500px;
    padding-top: 80px; /* Space for navbar (60px) + extra margin (20px) */
}

/* Account for impersonation banner */
body.impersonating .team-content {
    padding-top: 100px; /* Add extra 20px when impersonating */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Team Page Container - Work with existing footer system */
.team-page {
    background: var(--bg-primary);
    flex: 1; /* This ensures footer gets pushed down */
    width: 100%;
}

/* Ensure banner and nav don't interfere with flex layout */
.team-banner,
.team-header {
    flex-shrink: 0;
}

.team-nav {
    flex-shrink: 0;
}

/* Main content container */
.container {
    width: 100%;
    /* Remove flex properties that might interfere with footer */
}

/* Team content */
.team-content {
    padding-bottom: 2rem;
    width: 100%;
}

/* Banner Styles */
.team-banner {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.team-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(var(--team-primary-rgb), 0.8) 0%, 
        rgba(var(--team-secondary-rgb), 0.6) 100%);
    backdrop-filter: blur(2px);
}

.team-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

/* Default Header Styles */
.team-header {
    background: var(--gradient-primary);
    padding: 2rem 0;
    border-bottom: 3px solid rgba(var(--team-secondary-rgb), 0.3);
}

.team-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
}

/* Team Logo */
.team-logo {
    position: relative;
}

.team-logo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-logo img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* Team Info */
.team-info {
    text-align: center;
}

/* Team Info - More Specific Selectors */
.team-info .team-name,
.team-banner-content .team-name {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.team-info .team-tag,
.team-banner-content .team-tag {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 1rem;
}

/* Quick Stats */
.team-stats-quick {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

/* Navigation */
.team-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0;
}

.nav-item {
    padding: 1rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(var(--team-primary-rgb), 0.1);
    border-bottom-color: var(--team-primary);
}

.nav-item.active {
    color: var(--team-primary);
    background: rgba(var(--team-primary-rgb), 0.1);
    border-bottom-color: var(--team-primary);
}

.nav-item i {
    font-size: 1.1rem;
}

/* Main Content */
.team-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Overview Grid - Updated with proper alignment */
.team-content .overview-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 2rem !important;
    align-items: start !important;
    width: 100% !important;
    max-width: none !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    justify-content: unset !important;
}

/* Live Stream Takeover Styles */
.live-stream-takeover {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-bottom: 2rem !important;
    background: var(--bg-primary) !important;
    border-bottom: 2px solid var(--team-primary) !important;
}

.live-stream-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 1rem 2rem !important;
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.live-info {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
}

.live-indicator {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    color: #ff4444 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.live-indicator i {
    animation: pulse 2s infinite !important;
}

.stream-details h2 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1.25rem !important;
    color: var(--text-primary) !important;
}

.streamer-info {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
}

.streamer-info .fab {
    color: var(--team-primary) !important;
}

.gc-name {
    color: var(--text-muted) !important;
}

.viewer-count {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    color: var(--team-secondary) !important;
}

.scroll-down-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: var(--team-primary) !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
}

.scroll-down-btn:hover {
    background: var(--team-secondary) !important;
    transform: translateY(-2px) !important;
}

.scroll-down-btn i {
    animation: bounce 2s infinite !important;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.twitch-embed-container {
    width: 100% !important;
    height: 70vh !important;
    background: #000 !important;
}

.twitch-embed-container iframe {
    border: none !important;
    width: 100% !important;
    height: 100% !important;
}

/* Section Styles - Updated for Matches Container */
.team-content .overview-grid .roster-section {
    /* Roster spans 2 columns, first row */
    grid-column: 1 / span 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    min-height: fit-content !important;
    height: auto !important;
    max-height: none !important;
}

.team-content .overview-grid .matches-container {
    /* Third column, first row - contains both upcoming and recent matches */
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: start !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    min-height: fit-content !important;
    height: auto !important;
    max-height: none !important;
}

/* Individual match sections within the container */
.matches-container .upcoming-matches-section,
.matches-container .recent-matches-section {
    grid-column: unset !important;
    grid-row: unset !important;
    align-self: unset !important;
    margin-top: 0 !important;
}

.team-content .overview-grid .recent-vods-section {
    /* Spans all columns, second row */
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    align-self: start !important;
    margin-top: 1rem !important;
}

/* Recent VODs Section Styles - Optimized for Space */
.vods-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 0.75rem !important;
}

.vod-card {
    background: var(--bg-secondary) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.vod-card:hover {
    transform: translateY(-2px) !important;
    border-color: var(--team-primary) !important;
    box-shadow: 0 8px 25px rgba(var(--team-primary-rgb), 0.15) !important;
}

.vod-thumbnail {
    position: relative !important;
    aspect-ratio: 16/9 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.vod-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.vod-card:hover .vod-thumbnail img {
    transform: scale(1.05) !important;
}

.vod-badge {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    background: #666 !important;
    color: white !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.view-count {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.vod-info {
    padding: 0.75rem !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.vod-title {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex: 1 !important;
}

.vod-meta {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.8rem !important;
    color: var(--text-secondary) !important;
}

.vod-meta .streamer-name {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    color: var(--team-primary) !important;
}

.vod-meta .gc-name {
    color: var(--text-muted) !important;
}

.vod-date {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 0.75rem !important;
}

.watch-vod-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: var(--team-primary) !important;
    color: white !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    align-self: flex-start !important;
}

.watch-vod-btn:hover {
    background: var(--team-secondary) !important;
    transform: translateY(-1px) !important;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--team-primary);
    font-size: 1.2rem;
}

.member-count {
    background: var(--team-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.view-all-btn {
    color: var(--team-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--team-primary);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--team-primary);
    color: white;
}

/* Roster Grid */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Compact Roster Grid - Back to Original Grid Layout */
.team-content .roster-section .roster-grid-compact {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
    width: 100% !important;
}

.team-content .roster-section .roster-grid-compact .member-card-compact {
    background: var(--gradient-card) !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

/* Ineligible member styling */
.team-content .roster-section .roster-grid-compact .member-card-compact.ineligible {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.3), rgba(220, 53, 69, 0.15)) !important;
    border: 1px solid rgba(220, 53, 69, 0.5) !important;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.2) !important;
}

.team-content .roster-section .roster-grid-compact .member-card-compact.ineligible .member-avatar-compact img {
    opacity: 0.7 !important;
    filter: grayscale(30%) !important;
}

.team-content .roster-section .roster-grid-compact .member-card-compact.ineligible .member-name-compact .profile-link {
    color: #dc3545 !important;
}

.member-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.member-avatar-compact {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.member-avatar-compact img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.member-avatar-compact .role-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid var(--bg-primary);
}

.member-info-compact {
    text-align: center;
}

.member-details-compact {
    text-align: center;
}

.member-name-compact {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.member-name-compact .profile-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.member-name-compact .profile-link:hover {
    color: var(--team-primary);
    text-decoration: underline;
}

.member-role-compact {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.member-eligibility-compact {
    margin: 0.25rem 0 0.5rem 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-eligibility-compact.banned {
    color: #dc3545;
}

.member-eligibility-compact.new-member {
    color: #ffc107;
}

.eligibility-countdown {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

.social-links-compact {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.social-links-compact .social-link {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

/* Role Badge Colors */
.role-badge.manager {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.role-badge.leader,
.role-badge.coleader {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: white;
}

.role-badge.comanager {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

.role-badge.captain {
    background: linear-gradient(135deg, #4169E1, #0000CD);
    color: white;
}

.role-badge {
    background: linear-gradient(135deg, #696969, #2F4F4F);
    color: white;
}

/* Member Cards */
.member-card {
    background: var(--gradient-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(var(--team-primary-rgb), 0.5);
}

.member-card:hover::before {
    opacity: 1;
}

.member-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.role-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px solid var(--bg-secondary);
}

.role-badge.manager {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
}

.role-badge.co-manager {
    background: linear-gradient(45deg, #c0c0c0, #e8e8e8);
    color: #333;
}

.role-badge.captain {
    background: linear-gradient(45deg, #cd7f32, #deb887);
    color: #fff;
}

.member-info {
    text-align: center;
}

.member-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.member-role {
    font-size: 0.875rem;
    color: var(--team-primary);
    font-weight: 500;
    margin: 0 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-joined {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Match Lists - Optimized for Better Space Utilization */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Match Cards - Full Width Layout */
.match-card {
    background: var(--gradient-card);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--team-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-card:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(var(--team-primary-rgb), 0.5);
}

.match-card:hover::before {
    opacity: 1;
}

.match-card.win::before {
    background: #22c55e;
}

.match-card.loss::before {
    background: #ef4444;
}

.match-card.upcoming::before {
    background: var(--team-secondary);
}

/* Match Result/Status */
.match-result,
.match-status {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

/* Inline header for recent matches */
.match-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.match-header-inline .match-result {
    justify-content: flex-end;
    margin: 0;
}

.result-badge,
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge.win {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.result-badge.loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

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

/* Match Teams - Improved Layout */
.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.opponent-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.opponent-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.opponent-details {
    flex: 1;
    min-width: 0;
}

.opponent-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opponent-tag {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.match-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--team-primary);
    background: rgba(var(--team-primary-rgb), 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.vs-indicator {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

/* Match Maps - Improved Compact Layout */
.match-maps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}

.match-maps i {
    color: var(--team-secondary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.match-maps span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Map Preview Images - More Compact */
.map-preview {
    display: flex;
    gap: 0.375rem;
    margin: 0;
    flex-wrap: wrap;
}

.map-preview-item {
    position: relative;
    width: 50px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.map-preview-item:hover {
    transform: scale(1.1);
    z-index: 10;
}

.map-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-preview-item::after {
    content: attr(data-map-name);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 0.625rem;
    padding: 0.25rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.map-preview-item:hover::after {
    opacity: 1;
}

/* Enhanced Map Display - More Compact */
.match-maps-enhanced {
    margin: 0;
    padding: 0.75rem;
    background: rgba(var(--team-primary-rgb), 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--team-primary);
}

.match-maps-enhanced .maps-label {
    font-size: 0.75rem;
    color: var(--team-primary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Map Cards for larger displays */
.map-card-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.map-card-inline:hover {
    background: rgba(var(--team-primary-rgb), 0.1);
    border-color: rgba(var(--team-primary-rgb), 0.3);
}

.map-card-inline img {
    width: 32px;
    height: 24px;
    border-radius: 3px;
    object-fit: cover;
}

.map-card-inline span {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Match Date */
.match-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* No Matches State */
.no-matches {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-matches i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-matches p {
    margin: 0;
    font-size: 1rem;
}

/* Error Container */
.error-container {
    max-width: 600px;
    margin: 4rem auto;
    padding: 2rem;
    text-align: center;
    background: var(--gradient-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.error-container h2 {
    color: #ef4444;
    margin-bottom: 1rem;
}

/* Responsive Design - Updated for Matches Container */
@media (max-width: 1200px) {
    .team-content .overview-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }
    
    .team-content .overview-grid .roster-section {
        /* Roster spans full width on medium screens */
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }
    
    .team-content .overview-grid .matches-container {
        /* Full width, second row */
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        flex-direction: row !important;
        gap: 1.5rem !important;
    }
    
    .matches-container .upcoming-matches-section,
    .matches-container .recent-matches-section {
        flex: 1 !important;
    }
    
    .team-content .overview-grid .recent-vods-section {
        /* Full width, third row */
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
    }
    
    .team-content .overview-grid .twitch-section {
        grid-column: 1 / -1 !important;
    }
    
    /* Keep roster layout optimized at all screen sizes */
    .team-content .roster-section .roster-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 768px) {
    .team-content .overview-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .team-content .overview-grid .roster-section,
    .team-content .overview-grid .matches-container,
    .team-content .overview-grid .recent-vods-section {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    
    .team-content .overview-grid .matches-container {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .team-content .overview-grid .twitch-section {
        grid-column: 1 !important;
    }
    
    /* Keep compact grid layout for mobile */
    .team-content .roster-section .roster-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 0.5rem !important;
    }
    
    .team-header-content {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }
    
    .team-stats-quick {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .team-content {
        padding: 1rem;
    }
    
    .team-name {
        font-size: 2rem;
    }
    
    .team-tag {
        font-size: 1.125rem;
        margin-left: 0.5rem;
    }
    
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .roster-grid {
        grid-template-columns: 1fr;
    }
    
    .team-banner {
        height: 300px;
    }
    
    .team-banner-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .team-logo img {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .team-content {
        padding: 0.5rem;
    }
    
    .team-name {
        font-size: 1.5rem;
    }
    
    .team-stats-quick {
        flex-direction: column;
        gap: 1rem;
    }
    
    .match-teams {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .match-score,
    .vs-indicator {
        align-self: stretch;
        text-align: center;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Loading States */
.loading {
    animation: pulse 2s infinite;
}

/* Focus States for Accessibility */
.nav-item:focus,
.view-all-btn:focus,
.match-card:focus {
    outline: 2px solid var(--team-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .team-nav,
    .view-all-btn {
        display: none;
    }
    
    .team-page {
        background: white;
        color: black;
    }
    
    .member-card,
    .match-card {
        background: white;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* Stats Tables - Optimized Layout */
.stats-container {
    background: var(--gradient-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stats-table th {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border: none;
}

.stats-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stats-table tr:hover {
    background: rgba(var(--team-primary-rgb), 0.05);
}

.stats-table .player-name {
    font-weight: 600;
    color: var(--team-primary);
}

.stats-table .stat-number {
    font-weight: 500;
    text-align: center;
}

/* Map Stats Grid - Optimized for Space */
.map-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.map-stat-card {
    background: var(--gradient-card);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.map-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--team-primary);
    box-shadow: 0 8px 25px rgba(var(--team-primary-rgb), 0.15);
}

.map-stat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.map-stat-header img {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.map-stat-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.map-stat-record {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.map-stat-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    text-align: center;
}

.map-stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
}

.map-stat-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.map-stat-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.map-stat-item.win-rate .value {
    color: var(--team-primary);
}

/* Enhanced Responsive Tables */
@media (max-width: 768px) {
    .stats-table {
        font-size: 0.8rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.5rem;
    }
    
    .map-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .map-stat-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .map-stat-details {
        grid-template-columns: repeat(2, 1fr);
    }
}
.roster-organized {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.role-group {
    background: var(--gradient-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.role-group-title {
    background: var(--gradient-primary);
    color: white;
    margin: 0;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-count {
    font-weight: 400;
    opacity: 0.9;
    margin-left: auto;
}

.role-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.member-card.compact {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.member-card.compact .member-avatar img {
    width: 50px;
    height: 50px;
}

.member-card.compact .member-info h4 {
    font-size: 0.95rem;
    margin: 0.5rem 0 0.25rem 0;
}

.member-card.compact .member-joined {
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.social-link.discord {
    background: #5865F2;
    color: white;
}

.social-link.discord:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.social-link.twitch {
    background: #9146FF;
    color: white;
}

.social-link.twitch:hover {
    background: #7928CA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(145, 70, 255, 0.4);
}

/* Role Badge Updates */
.role-badge.leader {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.role-badge.co-leader {
    background: linear-gradient(135deg, #C0C0C0, #808080);
}

/* Mobile Responsiveness for Enhanced Roster */
@media (max-width: 768px) {
    .role-members {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .member-card.compact {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .member-card.compact .member-avatar {
        flex-shrink: 0;
    }
    
    .member-card.compact .member-info {
        flex: 1;
        min-width: 0;
    }
    
    .social-links {
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .roster-organized {
        gap: 1.5rem;
    }
    
    .role-group-title {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .social-link {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Twitch Streams Section */
.streams-section {
    margin-bottom: 2rem;
}

.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stream-card {
    background: var(--gradient-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.stream-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stream-card.live {
    border-color: #9146FF;
    box-shadow: 0 0 20px rgba(145, 70, 255, 0.2);
}

.stream-thumbnail {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.stream-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.stream-card:hover .stream-thumbnail img {
    transform: scale(1.05);
}

.live-indicator {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #9146FF;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #00FF00;
    border-radius: 50%;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.stream-info {
    padding: 1rem;
}

.stream-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.stream-streamer {
    margin: 0 0 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stream-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stream-game,
.stream-viewers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stream-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #9146FF;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stream-link:hover {
    background: #7928CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(145, 70, 255, 0.3);
}

/* Mobile Responsiveness for Streams */
@media (max-width: 768px) {
    .streams-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stream-thumbnail {
        height: 120px;
    }
    
    .stream-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}