:root {
    --dk: #C41E3A;
    --dh: #A330C9;
    --druid: #FF7C0A;
    --evoker: #33937F;
    --hunter: #AAD372;
    --mage: #3FC7EB;
    --monk: #00FF98;
    --paladin: #F48CBA;
    --priest: #FFFFFF;
    --rogue: #FFF468;
    --shaman: #0070DE;
    --warlock: #8788EE;
    --warrior: #C69B6D;

    --bg-color: #0b0c10;
    --panel-bg: rgba(31, 40, 51, 0.8);
    --text-primary: #c5c6c7;
    --text-highlight: #66fcf1;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.config-panel {
    width: 350px;
    background-color: var(--panel-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 2px 0 15px rgba(0,0,0,0.8);
    z-index: 10;
    border-right: 1px solid rgba(102, 252, 241, 0.2);
}

.config-panel h2 {
    margin-top: 0;
    color: var(--text-highlight);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.key-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.key-btn {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex: 1 1 40%;
}

.key-btn:hover {
    background: rgba(102, 252, 241, 0.1);
    border-color: var(--text-highlight);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 252, 241, 0.2);
}

.key-btn.active {
    background: var(--text-highlight);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.4);
    border-color: var(--text-highlight);
}

.info-text {
    margin-top: auto;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

/* Area for dashboard content */
.video-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligns to top so it scrolls nicely */
    background: linear-gradient(135deg, #0b0d17 0%, #151a30 100%);
    padding: 50px 40px;
    height: 100vh;
    overflow-y: auto; /* Scroll outer container */
    overflow-x: hidden; /* Prevent horizontal scrollbar from glowing elements */
    box-sizing: border-box;
}

/* Custom scrollbar on outer container for premium look */
.video-container::-webkit-scrollbar {
    width: 8px;
}
.video-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.video-container::-webkit-scrollbar-thumb {
    background: rgba(102, 252, 241, 0.2);
    border-radius: 4px;
}
.video-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 252, 241, 0.5);
}

.video-canvas {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    width: 100% !important;
    max-width: 1200px;
    box-sizing: border-box;
}

.bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(102, 252, 241, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.canvas-header {
    text-align: center;
    padding: 40px 0 20px;
    z-index: 2;
}

.canvas-header h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(102, 252, 241, 0.3);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-highlight);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.date-info {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.35);
    margin: 8px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

.ranking-container {
    flex-grow: 1;
    width: 90%;
    margin: 0 auto;
    position: relative; /* For absolute positioning of rows */
    z-index: 2;
}

/* Absolute positioning for FLIP animation */
.rank-row {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    /* Smooth transitions for moving up/down (top) and appearing (opacity) */
    transition: top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.rank-number {
    font-size: 1.8rem;
    font-weight: 900;
    color: rgba(255,255,255,0.4);
    width: 40px;
    text-align: right;
}

.spec-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--class-color, rgba(255,255,255,0.15));
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
    background-size: 110% 110%; /* Zoom 110% to crop the ugly default WoW jpg borders */
    background-position: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Premium row hover effects */
.rank-row:hover .spec-icon {
    transform: scale(1.12);
    box-shadow: 0 0 15px var(--class-color);
    border-color: var(--class-color);
}

.rank-row:hover .bar-fill {
    filter: brightness(1.15);
    box-shadow: 0 0 20px var(--class-color);
}


.bar-wrapper {
    flex-grow: 1;
    height: 100%;
    position: relative;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    /* Smooth transition for width */
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: inset 0 0 15px rgba(255,255,255,0.1);
}

.bar-fill-top {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.35;
    /* Smooth transition for width */
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Shine effect on bar */
.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shine 3s infinite;
    transform: skewX(-20deg);
}

@keyframes shine {
    0% { transform: translateX(-100%) skewX(-20deg); }
    100% { transform: translateX(200%) skewX(-20deg); }
}

.spec-name {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    white-space: nowrap;
    z-index: 10;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.spec-runs {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.dps-value {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    font-weight: 900;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    z-index: 10;
}

.canvas-footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 30px;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.25);
    z-index: 2;
    font-weight: 700;
    letter-spacing: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Role Selector Tabs Styling */
.role-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 30px auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 30px;
    width: fit-content;
    z-index: 2;
    position: relative;
    backdrop-filter: blur(10px);
}

.role-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.role-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.role-tab.active {
    background: var(--text-highlight);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.35);
    border-color: var(--text-highlight);
}

/* ── Ranking Legend ───────────────────────────────────────── */
.ranking-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 0 auto 24px auto;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 24px;
    border-radius: 30px;
    width: fit-content;
    z-index: 2;
    position: relative;
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.legend-color {
    width: 24px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-color.solid {
    background: var(--text-highlight);
    box-shadow: 0 0 8px rgba(102, 252, 241, 0.4);
}

.legend-color.transparent {
    background: var(--text-highlight);
    opacity: 0.35;
}

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        display: block !important;
    }

    .app-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
    }

    .config-panel {
        width: 100% !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 10px 12px !important;
        gap: 8px !important;
        box-shadow: 0 2px 15px rgba(0,0,0,0.8) !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(102, 252, 241, 0.2);
        box-sizing: border-box !important;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .config-panel h2 {
        display: none !important;
    }

    .key-buttons {
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .key-btn {
        padding: 10px 0 !important;
        font-size: 0.95rem !important;
        flex: 1 1 0 !important;
        text-align: center;
    }

    .video-container {
        height: auto !important;
        padding: 16px 10px !important;
        overflow-y: visible !important;
    }

    .video-canvas {
        max-width: 100% !important;
    }

    .canvas-header {
        padding: 16px 0 8px !important;
    }

    .canvas-header h1 {
        font-size: 1.6rem !important;
    }

    .subtitle {
        font-size: 0.9rem !important;
        letter-spacing: 2px !important;
    }

    .date-info {
        font-size: 0.6rem !important;
        letter-spacing: 1px !important;
    }

    .role-tabs {
        gap: 4px !important;
        padding: 3px !important;
        margin-bottom: 16px !important;
    }

    .role-tab {
        padding: 7px 12px !important;
        font-size: 0.8rem !important;
    }

    .ranking-legend {
        gap: 16px !important;
        padding: 6px 16px !important;
        margin-bottom: 16px !important;
        font-size: 0.75rem !important;
        border-radius: 20px !important;
    }

    .legend-color {
        width: 16px !important;
        height: 8px !important;
    }

    .ranking-container {
        width: 100% !important;
    }

    .rank-row {
        height: 42px !important;
        gap: 6px !important;
    }

    .rank-number {
        font-size: 1.1rem !important;
        width: 24px !important;
    }

    .spec-icon {
        width: 34px !important;
        height: 34px !important;
        border-radius: 6px !important;
    }

    .spec-name {
        font-size: 0.75rem !important;
        left: 8px !important;
    }

    .spec-runs {
        font-size: 0.6rem !important;
    }

    .dps-value {
        font-size: 0.85rem !important;
        right: 8px !important;
    }

    .canvas-footer {
        padding: 16px 0 !important;
        font-size: 0.85rem !important;
    }

    .bg-glow {
        display: none !important;
    }
}
