/* ============================================
   ROSTER PAGE STYLING - UNIFORM CARDS
   ============================================ */

/* Hero Section */
.roster-hero {
    position: relative; /* required for animated bg */
    overflow: hidden;
    text-align: center;
    margin-bottom: var(--space-8);
    padding: 10rem 0 4rem;
}

/* Cinematic animated blue background for roster hero */
.roster-hero::before {
    content: '';
    position: absolute;
    inset: -18% -12% -12% -12%;
    z-index: 0;
    /* Rich, saturated radial base for cinematic feel */
    background: radial-gradient(circle at 30% 25%, rgba(0,150,255,0.24), rgba(0,60,150,0.12) 40%, rgba(3,15,30,0.0) 70%);
    filter: blur(52px) saturate(125%) contrast(1.02);
    opacity: 0.98;
    pointer-events: none;
    transform: translateZ(0);
    /* Smooth transitions for filter/opacity on change */
    transition: filter 0.9s ease, opacity 0.9s ease, transform 0.9s ease;
    animation: roster-bg-cinematic 36s linear infinite;
}

/* Moving soft light sweep and animated radials for depth (enhanced & variable) */
.roster-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Use CSS variables for positions and sizes so JS can randomize them per load */
    background:
        radial-gradient(circle at var(--rad1-pos0, 20% 30%), rgba(0,200,255,var(--rad1-alpha,0.10)), transparent var(--rad1-falloff,35%)),
        radial-gradient(circle at var(--rad2-pos0, 80% 70%), rgba(0,110,255,var(--rad2-alpha,0.045)), transparent var(--rad2-falloff,45%)),
        linear-gradient(var(--vignette-angle, 180deg), rgba(0,0,0,0) var(--vignette-start, 24%), rgba(0,0,0,var(--vignette-opacity, 0.26)) 100%); /* vignette */
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: var(--rad1-size0, 42% 42%), var(--rad2-size0, 36% 36%), 100% 100%;
    background-position: var(--rad1-pos0, 20% 30%), var(--rad2-pos0, 80% 70%), 0% 0%;
    filter: blur(var(--vignette-blur, 44px));
    pointer-events: none;
    mix-blend-mode: screen;
    will-change: background-position, opacity, transform;
    /* Smooth transitions when variables change */
    transition: filter 0.9s ease, opacity 0.9s ease, background-position 1.2s ease, background-size 1.2s ease;
    animation: roster-sweep var(--sweep-duration, 20s) ease-in-out infinite, roster-radial-move var(--radial-duration, 18s) ease-in-out infinite;
}

/* Subtle layered sheen using a pseudo-gradient overlay */
.roster-hero .cinematic-sheen {
    position: absolute;
    inset: -10% -5% -30% -5%;
    z-index: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.02), rgba(0,120,255,0.06) 40%, rgba(255,255,255,0.00) 70%);
    filter: blur(36px);
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.9;
    animation: roster-sheen 28s ease-in-out infinite;
}

/* Search box ambient glow (animated) */
.roster-search::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 48px);
    height: calc(100% + 18px);
    border-radius: 12px;
    background: radial-gradient(circle, rgba(0,160,255,0.14), transparent 40%);
    z-index: 1;
    pointer-events: none;
    filter: blur(18px);
    opacity: 0.75;
    transition: opacity 0.35s ease, transform 0.35s ease;
    animation: roster-search-pulse 4.5s ease-in-out infinite;
}

/* Slight glow and lift on search focus for cinematic interaction */
.roster-search input:focus {
    box-shadow: 0 18px 56px rgba(0,120,255,0.30), inset 0 0 0 1px rgba(0,120,255,0.6);
    border-color: rgba(0,120,255,0.72);
    transform: translateY(-4px);
}

/* Ensure content sits above the background */
.roster-hero h1,
.roster-hero p,
.roster-hero .roster-search {
    position: relative;
    z-index: 2;
}

@keyframes roster-bg-cinematic {
    0% { transform: translateY(0) scale(1); opacity: 0.98; }
    50% { transform: translateY(-6px) scale(1.02); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 0.98; }
}

@keyframes roster-sweep {
    0% { opacity: 0.94; }
    35% { opacity: 1; }
    65% { opacity: 0.98; }
    100% { opacity: 0.94; }
}

@keyframes roster-radial-move {
    0% {
        background-position: var(--rad1-pos0, 18% 28%), var(--rad2-pos0, 82% 72%), 0% 0%;
        background-size: var(--rad1-size0, 42% 42%), var(--rad2-size0, 36% 36%), 100% 100%;
    }
    25% {
        background-position: var(--rad1-pos25, 28% 38%), var(--rad2-pos25, 72% 62%), 0% 0%;
        background-size: var(--rad1-size25, 46% 46%), var(--rad2-size25, 38% 38%), 100% 100%;
    }
    50% {
        background-position: var(--rad1-pos50, 22% 44%), var(--rad2-pos50, 68% 58%), 0% 0%;
        background-size: var(--rad1-size50, 50% 50%), var(--rad2-size50, 40% 40%), 100% 100%;
    }
    75% {
        background-position: var(--rad1-pos75, 12% 30%), var(--rad2-pos75, 78% 68%), 0% 0%;
        background-size: var(--rad1-size75, 44% 44%), var(--rad2-size75, 36% 36%), 100% 100%;
    }
    100% {
        background-position: var(--rad1-pos100, 18% 28%), var(--rad2-pos100, 82% 72%), 0% 0%;
        background-size: var(--rad1-size100, 42% 42%), var(--rad2-size100, 36% 36%), 100% 100%;
    }
}

@keyframes roster-search-pulse {
    0% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.98); }
    50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.03); }
    100% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.98); }
}

@keyframes roster-sheen {
    0% { transform: translateX(-8%) scale(1); opacity: 0.9; }
    50% { transform: translateX(8%) scale(1.02); opacity: 1; }
    100% { transform: translateX(-8%) scale(1); opacity: 0.9; }
}

/* Slight intensify on hover for desktop */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .roster-hero:hover::before { filter: blur(60px) saturate(150%) contrast(1.08); }
    .roster-hero:hover::after { filter: blur(44px) saturate(120%); }
    .roster-hero:hover .cinematic-sheen { opacity: 1; transform: translateX(12%); }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .roster-hero::before,
    .roster-hero::after,
    .roster-hero .cinematic-sheen,
    .roster-search::before {
        animation: none;
        transition: none;
    }
    .roster-search input:focus { transform: none; box-shadow: 0 6px 20px rgba(0,120,255,0.12); }
}

.roster-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--space-4);
    color: #FFFFFF;
}

.roster-hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Search Bar */
.roster-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.roster-search svg {
    position: absolute;
    left: 1.25rem;
    color: var(--color-muted);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.roster-search:focus-within svg {
    transform: translateY(-4px);
}

.roster-search input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.roster-search input::placeholder {
    color: var(--color-muted);
}

.roster-search input:focus {
    outline: none;
    border-color: rgba(0, 204, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Roster Sections */
.roster-section {
    padding: 4rem 0;
}

.roster-section .container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 3rem 0;
    text-align: center;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

/* Uniform Grid Layout */
.roster-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
}

/* Enhanced Roster Cards - Sharp Edges */
.roster-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: none;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
    height: 580px !important;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Top-right edge glow */
.roster-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color, rgba(59, 130, 246, 0.9)));
    box-shadow: 
        0 0 10px var(--accent-color, rgba(59, 130, 246, 0.6)),
        0 0 20px var(--accent-color, rgba(59, 130, 246, 0.4));
    transition: none;
    z-index: 10;
    pointer-events: none;
}

/* Top-right vertical edge */
.roster-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 120px;
    background: linear-gradient(180deg, var(--accent-color, rgba(59, 130, 246, 0.9)), transparent);
    box-shadow: 
        0 0 10px var(--accent-color, rgba(59, 130, 246, 0.6)),
        0 0 20px var(--accent-color, rgba(59, 130, 246, 0.4));
    transition: none;
    z-index: 10;
    pointer-events: none;
}

/* Bottom-left edge glow */
.roster-card-info::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color, rgba(59, 130, 246, 0.9)), transparent);
    box-shadow: 
        0 0 10px var(--accent-color, rgba(59, 130, 246, 0.6)),
        0 0 20px var(--accent-color, rgba(59, 130, 246, 0.4));
    transition: none;
    z-index: 10;
    pointer-events: none;
}

/* Bottom-left vertical edge */
.roster-card-info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2px;
    height: 120px;
    background: linear-gradient(180deg, transparent, var(--accent-color, rgba(59, 130, 246, 0.9)));
    box-shadow: 
        0 0 10px var(--accent-color, rgba(59, 130, 246, 0.6)),
        0 0 20px var(--accent-color, rgba(59, 130, 246, 0.4));
    transition: none;
    z-index: 10;
    pointer-events: none;
}

/* Optional custom background image */
.roster-card-bg {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--card-bg-image);
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 1;
    transition: none;
    pointer-events: none;
}

/* Avatar */
.roster-avatar {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: none;
    position: relative;
    z-index: 2;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: none;
    display: block;
}

/* Card Info Container */
.roster-card-info {
    padding: 1.25rem 1.5rem 1.5rem;
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

/* Username and Flag Container */
.roster-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

/* Username */
.roster-username {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #FFFFFF 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    word-break: break-word;
    text-align: left;
    flex: 1;
}

/* Country Flag */
.roster-flag {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: none;
}

/* Discord Username */
.roster-discord {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    position: relative;
    z-index: 1;
    word-break: break-word;
    text-align: center;
}

/* Role Badge - Corner Glow Style */
.roster-role {
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.7rem 1.2rem;
    position: relative;
    display: block;
    width: 100%;
    text-align: center;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, 
        var(--accent-color, rgba(59, 130, 246, 0.15)), 
        var(--accent-color, rgba(59, 130, 246, 0.08))
    );
    filter: drop-shadow(0 0 8px var(--accent-color, rgba(59, 130, 246, 0.4)));
}

/* Top-left corner accent - horizontal + vertical */
.roster-role::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 35px;
    height: 35px;
    background: 
        linear-gradient(90deg, var(--accent-color, rgba(59, 130, 246, 0.9)), transparent) top / 100% 2px no-repeat,
        linear-gradient(to bottom, var(--accent-color, rgba(59, 130, 246, 0.9)) 0%, var(--accent-color, rgba(59, 130, 246, 0.6)) 30%, var(--accent-color, rgba(59, 130, 246, 0.3)) 60%, transparent 100%) left / 2px 100% no-repeat;
    z-index: 2;
    pointer-events: none;
}

/* Bottom-right corner accent - horizontal + vertical */
.roster-role::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 35px;
    background: 
        linear-gradient(90deg, transparent, var(--accent-color, rgba(59, 130, 246, 0.9))) bottom / 100% 2px no-repeat,
        linear-gradient(to top, var(--accent-color, rgba(59, 130, 246, 0.9)) 0%, var(--accent-color, rgba(59, 130, 246, 0.6)) 30%, var(--accent-color, rgba(59, 130, 246, 0.3)) 60%, transparent 100%) right / 2px 100% no-repeat;
    z-index: 2;
    pointer-events: none;
}

/* Description (for management or featured members) */
.roster-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
    position: relative;
    z-index: 1;
    word-break: break-word;
    text-align: left;
}

/* Joined Date */
.roster-joined {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Social Links */
.roster-socials {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.roster-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: none;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.roster-socials svg {
    width: 18px;
    height: 18px;
}

/* Error State */
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.error-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

.error-state h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    color: rgba(255, 255, 255, 0.7);
}

.error-state p {
    font-size: 1rem;
    margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .roster-card {
        width: 300px !important;
        min-width: 300px !important;
        max-width: 300px !important;
    }
    
    .roster-grid {
        gap: 1.75rem;
    }
}

@media (max-width: 768px) {
    .roster-hero {
        padding: 6rem 0 4rem;
    }

    .roster-title {
        font-size: 2.5rem;
    }

    .roster-subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .roster-card {
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
    }
    
    .roster-grid {
        gap: 1.5rem;
    }

    .roster-card-info {
        padding: 1rem 1.25rem 1.25rem;
    }
    
    .roster-username {
        font-size: 1.15rem;
    }
    
    .roster-flag {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .roster-title {
        font-size: 1.75rem;
    }

    .roster-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .roster-card {
        width: 100% !important;
        min-width: unset !important;
        max-width: 400px !important;
        margin: 0 auto;
    }
    
    .roster-grid {
        gap: 1.25rem;
    }

    .roster-card-info {
        padding: 0.9rem 1.1rem 1.1rem;
    }
    
    .roster-username {
        font-size: 1.1rem;
    }
    
    .roster-flag {
        font-size: 1.5rem;
    }

    .roster-role {
        font-size: 0.75rem;
        padding: 0.5rem 0.9rem;
    }

    .roster-description {
        font-size: 0.85rem;
    }

    .roster-joined {
        font-size: 0.75rem;
    }
}
