/* ==========================================================================
   L2Heal Design Tokens & CSS Architecture
   ========================================================================== */

:root {
    /* -------------------------------------------------------------------------
       Color Palette
       ------------------------------------------------------------------------- */
    /* Primary brand colors */
    --l2h-gold: #4CA8FF;
    --l2h-gold-light: #7EC4FF;
    --l2h-gold-dark: #3A7FCC;
    --l2h-void: #8B5CF6;
    --l2h-void-light: #A78BFA;
    --l2h-void-dark: #6D28D9;

    /* Background colors */
    --l2h-bg-base: #0e0216;
    --l2h-bg-surface: #1a0a2e;
    --l2h-bg-elevated: #251240;
    --l2h-bg-drawer: #140826;

    /* Text colors */
    --l2h-text-primary: #f0e6ff;
    --l2h-text-secondary: #a99bbd;
    --l2h-text-muted: #7d6f93;

    /* Stat colors (WoW-inspired) */
    --l2h-stat-crit: #FF6B6B;
    --l2h-stat-haste: #4ECDC4;
    --l2h-stat-mastery: #9B59B6;
    --l2h-stat-vers: #3498DB;

    /* Status colors */
    --l2h-success: #4caf50;
    --l2h-warning: #ff9800;
    --l2h-error: #f44336;
    --l2h-info: #8B5CF6;

    /* Chat colors */
    --l2h-chat-user: #2d1650;
    --l2h-chat-user-gradient: linear-gradient(135deg, #2d1650 0%, #1f0e3d 100%);
    --l2h-chat-ai: var(--l2h-bg-surface);
    --l2h-chat-ai-gradient: linear-gradient(135deg, #1a0a2e 0%, #251240 100%);

    /* WoW class colors */
    --l2h-class-priest: #FFFFFF;
    --l2h-class-paladin: #F58CBA;
    --l2h-class-shaman: #0070DE;
    --l2h-class-druid: #FF7D0A;
    --l2h-class-monk: #00FF96;
    --l2h-class-evoker: #33937F;
    --l2h-class-warrior: #C79C6E;
    --l2h-class-mage: #40C7EB;
    --l2h-class-warlock: #8787ED;
    --l2h-class-hunter: #ABD473;
    --l2h-class-rogue: #FFF569;
    --l2h-class-deathknight: #C41F3B;
    --l2h-class-demonhunter: #A330C9;

    /* WoW item quality colors */
    --l2h-quality-legendary: #ff8000;
    --l2h-quality-epic: #a335ee;
    --l2h-quality-rare: #0070dd;
    --l2h-quality-uncommon: #1eff00;
    --l2h-quality-common: #ffffff;

    /* -------------------------------------------------------------------------
       Layout Dimensions
       ------------------------------------------------------------------------- */
    --l2h-appbar-height: 64px;
    --l2h-subnav-height: 80px;
    --l2h-header-total-height: calc(var(--l2h-appbar-height) + var(--l2h-subnav-height));
    --l2h-container-max-width: 1200px;
    --l2h-sidebar-width: 280px;

    /* -------------------------------------------------------------------------
       Spacing Scale
       ------------------------------------------------------------------------- */
    --l2h-space-xs: 4px;
    --l2h-space-sm: 8px;
    --l2h-space-md: 16px;
    --l2h-space-lg: 24px;
    --l2h-space-xl: 32px;
    --l2h-space-2xl: 48px;

    /* -------------------------------------------------------------------------
       Border Radius
       ------------------------------------------------------------------------- */
    --l2h-radius-sm: 4px;
    --l2h-radius-md: 8px;
    --l2h-radius-lg: 12px;
    --l2h-radius-xl: 16px;
    --l2h-radius-full: 9999px;

    /* -------------------------------------------------------------------------
       Transitions
       ------------------------------------------------------------------------- */
    --l2h-transition-fast: 150ms ease;
    --l2h-transition-normal: 250ms ease;
    --l2h-transition-slow: 400ms ease;

    /* -------------------------------------------------------------------------
       Shadows
       ------------------------------------------------------------------------- */
    --l2h-shadow-sm: 0 1px 2px rgba(14, 2, 22, 0.4);
    --l2h-shadow-md: 0 4px 6px rgba(14, 2, 22, 0.5);
    --l2h-shadow-lg: 0 10px 15px rgba(14, 2, 22, 0.6);
    --l2h-shadow-glow-gold: 0 0 10px rgba(76, 168, 255, 0.3);
    --l2h-shadow-glow-void: 0 0 10px rgba(139, 92, 246, 0.25);
    --l2h-shadow-glow-void-strong: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(109, 40, 217, 0.15);

    /* -------------------------------------------------------------------------
       Borders
       ------------------------------------------------------------------------- */
    --l2h-border-subtle: 1px solid rgba(139, 92, 246, 0.12);
    --l2h-border-default: 1px solid #2d1650;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--l2h-bg-base);
    color: var(--l2h-text-primary);
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Color utilities */
.l2h-gold { color: var(--l2h-gold); }
.l2h-void { color: var(--l2h-void); }
.l2h-text-muted { color: var(--l2h-text-muted); }
.l2h-text-secondary { color: var(--l2h-text-secondary); }

/* Stat color utilities */
.l2h-stat-crit { color: var(--l2h-stat-crit); }
.l2h-stat-haste { color: var(--l2h-stat-haste); }
.l2h-stat-mastery { color: var(--l2h-stat-mastery); }
.l2h-stat-vers { color: var(--l2h-stat-vers); }

/* WoW class color utilities */
.l2h-class-priest { color: var(--l2h-class-priest); }
.l2h-class-paladin { color: var(--l2h-class-paladin); }
.l2h-class-shaman { color: var(--l2h-class-shaman); }
.l2h-class-druid { color: var(--l2h-class-druid); }
.l2h-class-monk { color: var(--l2h-class-monk); }
.l2h-class-evoker { color: var(--l2h-class-evoker); }
.l2h-class-warrior { color: var(--l2h-class-warrior); }
.l2h-class-mage { color: var(--l2h-class-mage); }
.l2h-class-warlock { color: var(--l2h-class-warlock); }
.l2h-class-hunter { color: var(--l2h-class-hunter); }
.l2h-class-rogue { color: var(--l2h-class-rogue); }
.l2h-class-deathknight { color: var(--l2h-class-deathknight); }
.l2h-class-demonhunter { color: var(--l2h-class-demonhunter); }

/* Mythic+ rating tier colors */
.l2h-mplus-legendary { color: var(--l2h-quality-legendary); }
.l2h-mplus-epic { color: var(--l2h-quality-epic); }
.l2h-mplus-rare { color: var(--l2h-quality-rare); }
.l2h-mplus-uncommon { color: var(--l2h-quality-uncommon); }
.l2h-mplus-common { color: var(--l2h-quality-common); }
.l2h-mplus-poor { color: #9d9d9d; }

/* Background utilities */
.l2h-bg-surface { background-color: var(--l2h-bg-surface); }
.l2h-bg-elevated { background-color: var(--l2h-bg-elevated); }

/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Main content area */
.l2h-main-content {
    padding-top: calc(var(--l2h-header-total-height) + var(--l2h-space-md));
}

/* AppBar styling */
.mud-appbar {
    background-color: var(--l2h-bg-drawer) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

/* AppBar branding */
.l2h-appbar-title {
    color: var(--l2h-gold);
    font-weight: bold;
}

.l2h-appbar-subtitle {
    color: var(--l2h-text-muted);
}

/* ==========================================================================
   Character Sub-Navigation
   ========================================================================== */

.character-subnav {
    position: fixed;
    top: var(--l2h-appbar-height);
    left: 0;
    right: 0;
    z-index: 1099;
    background: linear-gradient(180deg, var(--l2h-bg-drawer) 0%, rgba(20, 8, 38, 0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: var(--l2h-border-default);
    min-height: var(--l2h-subnav-height);
    display: flex;
    align-items: center;
    transition: box-shadow var(--l2h-transition-normal);
}

.character-subnav:hover {
    box-shadow: var(--l2h-shadow-md);
}

/* ==========================================================================
   Character Search Form
   ========================================================================== */

.search-form-container {
    width: 100%;
}

.search-form {
    width: 100%;
}

.search-field {
    margin: 0 !important;
}

.search-field .mud-input-label {
    font-size: 0.75rem;
}

.search-field-region {
    width: 75px;
    min-width: 75px;
    flex-shrink: 0;
}

.search-field-realm {
    min-width: 120px;
    flex: 2 1 160px;
}

.search-field-name {
    min-width: 100px;
    flex: 1 1 120px;
}

.search-button {
    min-width: 48px;
    width: 48px;
    height: 40px;
    flex-shrink: 0;
}

.search-error {
    display: block;
    margin-top: 6px;
    padding-left: 2px;
}

/* Ensure consistent input heights */
.search-form .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.search-form .mud-input-slot {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

/* ==========================================================================
   MudBlazor Popover/Dropdown Overrides
   ========================================================================== */

/* Constrain autocomplete dropdown width to match input */
.mud-autocomplete .mud-popover-open {
    max-width: 250px;
}

/* Constrain select dropdown width */
.mud-select .mud-popover-open {
    min-width: unset !important;
}

/* ==========================================================================
   Chat Split Layout
   ========================================================================== */

.chat-split-layout {
    display: grid;
    grid-template-columns: 1fr;
    height: calc(100vh - var(--l2h-header-total-height) - var(--l2h-space-xl) - var(--l2h-space-md));
    gap: 0;
    max-width: var(--l2h-container-max-width);
    margin: 0 auto;
    transition: grid-template-columns 0.3s ease, max-width 0.3s ease;
}

.chat-split-layout.panel-open {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: none;
    padding-left: 12px;
    margin-right: -16px;
}

.chat-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.analysis-pane {
    overflow-y: auto;
    border-left: var(--l2h-border-subtle);
    background: var(--l2h-bg-surface);
    border-radius: var(--l2h-radius-md);
    padding: var(--l2h-space-md);
}

.analysis-pane.collapsed {
    display: none;
}

/* Analysis pane scrollbar */
.analysis-pane::-webkit-scrollbar {
    width: 6px;
}

.analysis-pane::-webkit-scrollbar-track {
    background: transparent;
}

.analysis-pane::-webkit-scrollbar-thumb {
    background: var(--l2h-bg-elevated);
    border-radius: var(--l2h-radius-full);
}

.analysis-pane::-webkit-scrollbar-thumb:hover {
    background: var(--l2h-gold-dark);
}

/* ==========================================================================
   Fight Analysis Panel
   ========================================================================== */

.analysis-panel-content {
    min-height: 100%;
}

.analysis-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    text-align: center;
}

.analysis-loading {
    padding: var(--l2h-space-sm);
}

.analysis-header {
    border-bottom: var(--l2h-border-subtle);
    padding-bottom: var(--l2h-space-sm);
}

.analysis-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--l2h-space-sm);
}

.analysis-stat-card {
    background: var(--l2h-bg-base);
    border-radius: var(--l2h-radius-sm);
    padding: var(--l2h-space-sm) var(--l2h-space-md);
    text-align: center;
}

.analysis-stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--l2h-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.analysis-stat-card .stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--l2h-text-primary);
}

/* ==========================================================================
   Chat Interface
   ========================================================================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.messages-area {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--l2h-space-md);
    min-height: 0;
    scroll-behavior: smooth;
}

/* Custom scrollbar for messages */
.messages-area::-webkit-scrollbar {
    width: 8px;
}

.messages-area::-webkit-scrollbar-track {
    background: var(--l2h-bg-base);
    border-radius: var(--l2h-radius-full);
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--l2h-bg-elevated);
    border-radius: var(--l2h-radius-full);
    transition: background var(--l2h-transition-fast);
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: var(--l2h-gold-dark);
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--l2h-space-lg);
}

.welcome-icon {
    color: var(--l2h-gold);
    font-size: 4rem;
}

.welcome-title {
    color: var(--l2h-gold);
}

.example-questions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
    gap: var(--l2h-space-sm);
}

.messages-list {
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   Chat Messages - Discord-like Layout
   ========================================================================== */

.chat-message {
    padding: var(--l2h-space-xs) 0;
    transition: background-color var(--l2h-transition-fast);
}

.chat-message:hover {
    background-color: rgba(139, 92, 246, 0.04);
}

.message-avatar {
    flex-shrink: 0;
    padding-top: 2px;
}

.chat-avatar-user {
    background-color: var(--l2h-chat-user);
}

.chat-avatar-user .mud-avatar-img,
.chat-avatar-user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar-ai {
    background-color: transparent;
}

.chat-avatar-ai .mud-avatar-img,
.chat-avatar-ai img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-content-user {
    text-align: right;
    max-width: 70%;
}

.chat-message-ai .message-content {
    max-width: 85%;
}

.message-header {
    margin-bottom: var(--l2h-space-xs);
}

.message-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--l2h-text-primary);
}

.message-author-ai {
    color: var(--l2h-gold);
}

.message-timestamp {
    color: var(--l2h-text-muted);
    font-size: 0.75rem;
}

.message-body {
    color: var(--l2h-text-primary);
    line-height: 1.5;
}

.message-footer {
    opacity: 0.8;
}

/* Legacy bubble classes - keep for typing indicator */
.chat-bubble {
    max-width: 70%;
    padding: var(--l2h-space-md);
    transition: box-shadow var(--l2h-transition-fast);
}

.chat-bubble:hover {
    box-shadow: var(--l2h-shadow-md);
}

.chat-bubble-user {
    background: var(--l2h-chat-user-gradient);
    border-radius: var(--l2h-radius-lg) var(--l2h-radius-lg) 0 var(--l2h-radius-lg);
    white-space: pre-wrap;
}

.chat-bubble-ai {
    background: var(--l2h-chat-ai-gradient);
    border-radius: var(--l2h-radius-lg) var(--l2h-radius-lg) var(--l2h-radius-lg) 0;
}

.chat-avatar {
    background-color: var(--l2h-gold);
}

.chat-timestamp {
    color: var(--l2h-text-secondary);
    font-size: 0.75rem;
    margin-top: var(--l2h-space-xs);
}

.loading-message {
    color: var(--l2h-text-secondary);
    font-style: italic;
}

/* Response source chip styling */
.source-chip {
    font-size: 0.65rem !important;
    height: 20px !important;
    padding: 0 8px !important;
}

.source-chip .mud-chip-content {
    padding: 0 !important;
}

/* Token usage display */
.token-usage {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--l2h-text-muted);
    font-size: 0.65rem;
}

.token-icon {
    font-size: 0.8rem !important;
    opacity: 0.7;
}

/* Clickable source link chips (WarcraftLogs links) */
.source-link-chip {
    font-size: 0.65rem !important;
    height: 22px !important;
    padding: 0 8px !important;
    cursor: pointer;
    transition: transform var(--l2h-transition-fast), box-shadow var(--l2h-transition-fast);
}

.source-link-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--l2h-shadow-sm);
}

.source-link-chip .mud-chip-content {
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.source-link-chip .mud-icon-root {
    font-size: 0.75rem !important;
}

/* ==========================================================================
   Markdown Content Styling
   ========================================================================== */

.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    color: var(--l2h-gold);
    margin-top: var(--l2h-space-md);
    margin-bottom: var(--l2h-space-sm);
    font-weight: 600;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child {
    margin-top: 0;
}

.markdown-content h1 { font-size: 1.5rem; }
.markdown-content h2 { font-size: 1.3rem; }
.markdown-content h3 { font-size: 1.15rem; }
.markdown-content h4 { font-size: 1rem; }

.markdown-content p {
    margin-bottom: var(--l2h-space-sm);
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: var(--l2h-space-sm) 0;
    padding-left: var(--l2h-space-lg);
}

.markdown-content li {
    margin-bottom: var(--l2h-space-xs);
}

.markdown-content strong {
    color: var(--l2h-gold-light);
    font-weight: 600;
}

.markdown-content em {
    color: var(--l2h-text-secondary);
    font-style: italic;
}

.markdown-content code {
    background-color: var(--l2h-bg-base);
    padding: 2px 6px;
    border-radius: var(--l2h-radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background-color: var(--l2h-bg-base);
    padding: var(--l2h-space-md);
    border-radius: var(--l2h-radius-md);
    overflow-x: auto;
    margin: var(--l2h-space-sm) 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--l2h-bg-elevated);
    margin: var(--l2h-space-md) 0;
}

.markdown-content blockquote {
    border-left: 3px solid var(--l2h-gold);
    margin: var(--l2h-space-sm) 0;
    padding-left: var(--l2h-space-md);
    color: var(--l2h-text-secondary);
}

.markdown-content a {
    color: var(--l2h-void-light);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: var(--l2h-space-sm) 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--l2h-bg-elevated);
    padding: var(--l2h-space-sm);
    text-align: left;
}

.markdown-content th {
    background-color: var(--l2h-bg-base);
    color: var(--l2h-gold);
}

/* ==========================================================================
   Chat Input
   ========================================================================== */

.chat-input-container {
    background-color: var(--l2h-bg-surface);
    padding: var(--l2h-space-md);
    border-radius: var(--l2h-radius-md);
    transition: box-shadow var(--l2h-transition-fast);
}

.chat-input-container:focus-within {
    box-shadow: 0 0 0 2px var(--l2h-gold), var(--l2h-shadow-glow-gold), var(--l2h-shadow-glow-void);
}

/* Send button height fix - stretch to match input */
.chat-input-row {
    align-items: stretch;
}

.chat-input-row .mud-button-root {
    align-self: stretch;
    height: auto;
    min-height: 56px;
}

/* ==========================================================================
   Chat Status Bar
   ========================================================================== */

.chat-status-bar {
    background-color: var(--l2h-bg-drawer);
    border-bottom: var(--l2h-border-default);
}

/* ==========================================================================
   Fight Context Chips (Boss/Difficulty indicators on AI messages)
   ========================================================================== */

.fight-context-header {
    padding-left: 4px;
    margin-left: 0;
}

.fight-context-chip {
    font-size: 0.7rem !important;
    height: 24px !important;
    cursor: pointer;
    transition: transform var(--l2h-transition-fast), box-shadow var(--l2h-transition-fast);
}

.fight-context-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--l2h-shadow-sm);
}

.fight-context-chip .mud-chip-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fight-context-chip .mud-icon-root {
    font-size: 0.8rem !important;
}

/* Difficulty color classes */
.difficulty-mythic {
    background-color: #9B59B6 !important;  /* Purple */
    color: white !important;
}

.difficulty-heroic {
    background-color: #E67E22 !important;  /* Orange */
    color: white !important;
}

.difficulty-normal {
    background-color: #27AE60 !important;  /* Green */
    color: white !important;
}

.difficulty-lfr {
    background-color: #3498DB !important;  /* Blue */
    color: white !important;
}

.difficulty-unknown {
    background-color: #7F8C8D !important;  /* Gray */
    color: white !important;
}

/* ==========================================================================
   Character Summary Bar
   ========================================================================== */

.character-name {
    color: var(--l2h-gold);
    font-weight: bold;
}

.healer-badge {
    background-color: var(--l2h-success);
    color: white;
    padding: var(--l2h-space-xs) var(--l2h-space-md);
    border-radius: var(--l2h-radius-full);
    font-size: 0.7rem;
}

.tank-badge {
    background-color: #1976d2;
    color: white;
    padding: var(--l2h-space-xs) var(--l2h-space-md);
    border-radius: var(--l2h-radius-full);
    font-size: 0.7rem;
}

.dps-badge {
    background-color: #c62828;
    color: white;
    padding: var(--l2h-space-xs) var(--l2h-space-md);
    border-radius: var(--l2h-radius-full);
    font-size: 0.7rem;
}

.item-level {
    color: var(--l2h-gold);
    font-weight: bold;
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */

.stat-card {
    background-color: var(--l2h-bg-surface);
    border-radius: var(--l2h-radius-md);
    padding: var(--l2h-space-md);
    transition: transform var(--l2h-transition-fast), box-shadow var(--l2h-transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--l2h-shadow-md);
}

/* ==========================================================================
   Gear Items
   ========================================================================== */

.gear-item {
    border-left: 3px solid var(--l2h-gold);
    padding-left: var(--l2h-space-md);
    margin-bottom: var(--l2h-space-sm);
    transition: border-color var(--l2h-transition-fast);
}

.gear-item.legendary {
    border-left-color: var(--l2h-quality-legendary);
}

.gear-item.epic {
    border-left-color: var(--l2h-quality-epic);
}

.gear-item.rare {
    border-left-color: var(--l2h-quality-rare);
}

.gear-item.uncommon {
    border-left-color: var(--l2h-quality-uncommon);
}

/* Item quality text colors */
.l2h-quality-legendary { color: var(--l2h-quality-legendary); }
.l2h-quality-epic { color: var(--l2h-quality-epic); }
.l2h-quality-rare { color: var(--l2h-quality-rare); }
.l2h-quality-uncommon { color: var(--l2h-quality-uncommon); }
.l2h-quality-common { color: var(--l2h-quality-common); }
.l2h-quality-poor { color: #9d9d9d; }

/* Gear display specific styles */
.gear-chip {
    background-color: var(--l2h-bg-base);
    font-size: 0.7rem;
}

.enchant-text {
    color: var(--l2h-quality-uncommon);
}

/* ==========================================================================
   Interactive Elements
   ========================================================================== */

/* Button hover lift effect */
.l2h-btn-lift {
    transition: transform var(--l2h-transition-fast), box-shadow var(--l2h-transition-fast);
}

.l2h-btn-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--l2h-shadow-md);
}

/* Focus states for accessibility */
.l2h-focus-visible:focus-visible {
    outline: 2px solid var(--l2h-gold);
    outline-offset: 2px;
}

/* ==========================================================================
   Error Boundary
   ========================================================================== */

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ==========================================================================
   Legacy compatibility classes (prefer new classes above)
   ========================================================================== */

.wow-gold { color: var(--l2h-gold); }
.wow-void { color: var(--l2h-void); }

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 600px) {
    :root {
        --l2h-subnav-height: auto;
    }

    .character-subnav {
        min-height: auto;
        padding: var(--l2h-space-sm) 0;
    }

    /* Search form responsive layout */
    .search-form {
        flex-wrap: wrap !important;
    }

    .search-form .search-field-region {
        width: 70px;
        min-width: 70px;
    }

    .search-form .search-field-realm,
    .search-form .search-field-name {
        flex: 1 1 120px;
        min-width: 100px;
    }

    .search-form .search-button {
        margin-left: auto;
    }

    .search-error {
        margin-top: 4px;
    }

    .chat-bubble {
        max-width: 85%;
    }

    .chat-split-layout {
        height: calc(100vh - var(--l2h-appbar-height) - 120px - var(--l2h-space-xl));
    }
}

@media (max-width: 960px) {
    .chat-bubble {
        max-width: 80%;
    }

    /* On mobile/tablet, panel overlays as a slide-out drawer */
    .chat-split-layout.panel-open {
        grid-template-columns: 1fr;
    }

    .chat-split-layout.panel-open .analysis-pane {
        position: fixed;
        right: 0;
        top: var(--l2h-header-total-height);
        bottom: 0;
        width: 90vw;
        max-width: 500px;
        z-index: 1098;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        border-radius: 0;
        border-left: var(--l2h-border-default);
    }
}

/* ==========================================================================
   Streaming Response Transitions
   ========================================================================== */

/* Smooth fade-in animation for charts and summary cards appearing during streaming */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-chart-container,
.summary-card {
    animation: fadeSlideIn 0.3s ease-out;
}

/* Streaming state: faded to signal "in progress", fades up when complete */
.markdown-content {
    opacity: 1;
    transition: opacity 0.25s ease-out;
}

.markdown-content.streaming {
    opacity: 0.7;
}

/* Collapsible sections also get smooth entrance */
.collapse-content {
    animation: fadeSlideIn 0.25s ease-out;
    line-height: 1.6;
}

/* Table styling for collapse-content (same as markdown-content) */
.collapse-content table {
    border-collapse: collapse;
    width: 100%;
    margin: var(--l2h-space-sm) 0;
}

.collapse-content th,
.collapse-content td {
    border: 1px solid var(--l2h-bg-elevated);
    padding: var(--l2h-space-sm);
    text-align: left;
}

.collapse-content th {
    background-color: var(--l2h-bg-base);
    color: var(--l2h-gold);
}

/* Other markdown styling for collapse-content */
.collapse-content strong {
    color: var(--l2h-gold-light);
    font-weight: 600;
}

.collapse-content ul,
.collapse-content ol {
    margin: var(--l2h-space-sm) 0;
    padding-left: var(--l2h-space-lg);
}

.collapse-content li {
    margin-bottom: var(--l2h-space-xs);
}

/* ==========================================================================
   Top Performer Gear Modal
   ========================================================================== */

/* Gear card - single link per item, quality indicated by left border */
.gear-card {
    background: rgba(139, 92, 246, 0.03);
    border-left: 3px solid var(--l2h-text-muted);
    border-radius: 0 var(--l2h-radius-sm) var(--l2h-radius-sm) 0;
    padding: 8px 12px;
    margin-bottom: 8px;
    transition: background-color var(--l2h-transition-fast);
}

.gear-card:hover {
    background: rgba(139, 92, 246, 0.07);
}

.gear-card.quality-legendary { border-left-color: var(--l2h-quality-legendary); }
.gear-card.quality-epic { border-left-color: var(--l2h-quality-epic); }
.gear-card.quality-rare { border-left-color: var(--l2h-quality-rare); }
.gear-card.quality-uncommon { border-left-color: var(--l2h-quality-uncommon); }
.gear-card.quality-common { border-left-color: var(--l2h-text-muted); }

.gear-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gear-item-name {
    font-weight: 500;
    text-decoration: none;
}

.gear-item-name:hover {
    text-decoration: underline;
}

/* Item level badge */
.gear-ilvl {
    font-weight: 600;
    color: var(--l2h-gold);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Card details row (slot + enchant) */
.gear-card-details {
    font-size: 0.75rem;
    color: var(--l2h-text-muted);
    margin-top: 2px;
}

.gear-slot {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gear-enchant {
    color: var(--l2h-quality-uncommon);
}

/* Gems row */
.gear-gems {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.gear-gem {
    font-size: 0.65rem;
    background: var(--l2h-bg-base);
    color: var(--l2h-text-secondary);
    padding: 2px 6px;
    border-radius: 3px;
}

.gear-gem-link {
    font-size: 0.65rem;
    background: var(--l2h-bg-base);
    color: var(--l2h-quality-rare);
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.gear-gem-link:hover {
    text-decoration: underline;
    background: var(--l2h-bg-elevated);
}

/* Comparison row */
.gear-comparison {
    font-size: 0.7rem;
    color: var(--l2h-text-secondary);
    background: rgba(139, 92, 246, 0.05);
    padding: 4px 8px;
    margin-top: 6px;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gear-comparison.higher {
    color: var(--l2h-success);
}

.gear-comparison.lower {
    color: var(--l2h-warning);
}

.gear-comparison-link {
    color: inherit;
    text-decoration: none;
}

.gear-comparison-link:hover {
    text-decoration: underline;
}

.ilvl-diff {
    font-weight: 600;
    margin-left: var(--l2h-space-sm);
}

.ilvl-diff.positive {
    color: var(--l2h-success);
}

.ilvl-diff.negative {
    color: var(--l2h-warning);
}

/* Expansion panel customization for gear groups */
.gear-expansion-panel .mud-expand-panel-header {
    padding: var(--l2h-space-sm) var(--l2h-space-md);
    background-color: var(--l2h-bg-elevated);
}

.gear-expansion-panel .mud-expand-panel-content {
    padding: 0;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Landing Page Styles
   ========================================================================== */

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Keyframe animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoPulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.3),
                    0 0 80px rgba(76, 168, 255, 0.15);
    }
    50% {
        box-shadow: 0 0 60px rgba(139, 92, 246, 0.4),
                    0 0 120px rgba(76, 168, 255, 0.2);
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

@keyframes voidMeteor {
    0% {
        transform: rotate(var(--angle)) translateX(0);
        opacity: 0;
    }
    3% {
        opacity: 1;
    }
    80% {
        opacity: 0.5;
    }
    100% {
        transform: rotate(var(--angle)) translateX(var(--travel));
        opacity: 0;
    }
}

@keyframes buttonShine {
    from {
        transform: translateX(-100%) skewX(-15deg);
    }
    to {
        transform: translateX(200%) skewX(-15deg);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* -------------------------------------------------------------------------
   Scroll-triggered animation base
   ------------------------------------------------------------------------- */
.lp-animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.lp-animate-in.lp-visible {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------------------------------------------
   Section 1: Hero — Centered Portal Layout
   ------------------------------------------------------------------------- */
.lp-hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(14, 2, 22, 0.85) 75%, #0e0216 100%),
        url('/images/bg.webp') center center / cover no-repeat;
    background-color: #0e0216;
}

/* Animated particles */
.lp-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--l2h-void);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 15s linear infinite;
}

/* Every 3rd particle is gold (Sunwell sparks in the void) */
.particle:nth-child(3n) {
    background: var(--l2h-gold);
}

.particle:nth-child(1) { left: 5%;  animation-delay: 0s;  animation-duration: 12s; }
.particle:nth-child(2) { left: 18%; animation-delay: 2s;  animation-duration: 18s; }
.particle:nth-child(3) { left: 30%; animation-delay: 5s;  animation-duration: 14s; }
.particle:nth-child(4) { left: 42%; animation-delay: 8s;  animation-duration: 16s; }
.particle:nth-child(5) { left: 55%; animation-delay: 1s;  animation-duration: 20s; }
.particle:nth-child(6) { left: 68%; animation-delay: 4s;  animation-duration: 13s; }
.particle:nth-child(7) { left: 80%; animation-delay: 7s;  animation-duration: 17s; }
.particle:nth-child(8) { left: 92%; animation-delay: 10s; animation-duration: 15s; }

/* Void meteors — diagonal streaks with trailing tails */
.lp-void-rain {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.raindrop {
    position: absolute;
    height: 2px;
    width: var(--len, 80px);
    --angle: 30deg;
    --travel: 900px;
    background: linear-gradient(to right, transparent, rgba(139, 92, 246, 0.3) 40%, rgba(180, 160, 255, 0.9));
    border-radius: 0 2px 2px 0;
    opacity: 0;
    animation: voidMeteor linear infinite;
    filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.5));
}

/* Bright head glow */
.raindrop::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -2px;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(220, 210, 255, 0.95), rgba(139, 92, 246, 0.4) 60%, transparent);
    border-radius: 50%;
}

/* Blue-tinted variant */
.raindrop:nth-child(3n) {
    background: linear-gradient(to right, transparent, rgba(76, 168, 255, 0.2) 40%, rgba(160, 200, 255, 0.85));
    filter: drop-shadow(0 0 3px rgba(76, 168, 255, 0.5));
}
.raindrop:nth-child(3n)::after {
    background: radial-gradient(circle, rgba(200, 220, 255, 0.95), rgba(76, 168, 255, 0.4) 60%, transparent);
}

/*
   12 meteors — varied angles, spread-out delays so only ~1 visible at a time.
   rotate() + translateX() means the tail naturally follows the head.
   Directions: down-right shallow, down-right steep, down-left shallow, down-left steep, near-vertical.
*/

/* Down-right, shallow */
.raindrop:nth-child(1)  { left: -5%;  top: 15%; --angle: 22deg;  --travel: 1100px; --len: 90px;  animation-delay: 0s;    animation-duration: 1.8s; }
.raindrop:nth-child(2)  { left: 30%;  top: -5%; --angle: 35deg;  --travel: 950px;  --len: 70px;  animation-delay: 7.5s;  animation-duration: 1.5s; }

/* Down-left, shallow */
.raindrop:nth-child(3)  { left: 95%;  top: 10%; --angle: 155deg; --travel: 1000px; --len: 85px;  animation-delay: 3.2s;  animation-duration: 1.7s; }
.raindrop:nth-child(4)  { left: 75%;  top: -3%; --angle: 148deg; --travel: 900px;  --len: 60px;  animation-delay: 18.0s; animation-duration: 1.4s; }

/* Down-right, steep */
.raindrop:nth-child(5)  { left: 5%;   top: -8%; --angle: 58deg;  --travel: 1200px; --len: 100px; animation-delay: 11.5s; animation-duration: 2.0s; height: 2.5px; }
.raindrop:nth-child(6)  { left: 40%;  top: -5%; --angle: 65deg;  --travel: 1000px; --len: 55px;  animation-delay: 24.0s; animation-duration: 1.6s; }

/* Down-left, steep */
.raindrop:nth-child(7)  { left: 85%;  top: -5%; --angle: 120deg; --travel: 1100px; --len: 75px;  animation-delay: 5.8s;  animation-duration: 1.9s; }
.raindrop:nth-child(8)  { left: 70%;  top: 5%;  --angle: 115deg; --travel: 950px;  --len: 95px;  animation-delay: 20.5s; animation-duration: 1.7s; }

/* Near-vertical */
.raindrop:nth-child(9)  { left: 55%;  top: -8%; --angle: 82deg;  --travel: 1100px; --len: 65px;  animation-delay: 15.0s; animation-duration: 1.8s; }
.raindrop:nth-child(10) { left: 20%;  top: -5%; --angle: 95deg;  --travel: 1000px; --len: 50px;  animation-delay: 9.0s;  animation-duration: 1.5s; }

/* Big bright ones (rare) */
.raindrop:nth-child(11) { left: 10%;  top: -3%; --angle: 42deg;  --travel: 1300px; --len: 130px; animation-delay: 27.0s; animation-duration: 2.2s; height: 3px; }
.raindrop:nth-child(11)::after { width: 8px; height: 8px; top: -3px; }

.raindrop:nth-child(12) { left: 80%;  top: 8%;  --angle: 138deg; --travel: 1200px; --len: 110px; animation-delay: 22.0s; animation-duration: 2.0s; height: 3px; }
.raindrop:nth-child(12)::after { width: 8px; height: 8px; top: -3px; }

/* Hide extras (only using 12 of the 20 spans) */
.raindrop:nth-child(n+13) { display: none; }

/* Hero grid: 55/45 split (legacy, kept for reference) */
.lp-hero-grid {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: var(--l2h-space-2xl);
    align-items: center;
    max-width: 1200px;
    width: 100%;
    padding: var(--l2h-space-2xl) var(--l2h-space-xl);
    z-index: 1;
}

/* Hero centered: portal layout */
.lp-hero-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--l2h-space-md);
    max-width: 500px;
    width: 100%;
    padding: var(--l2h-space-xl) var(--l2h-space-md);
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

.lp-hero-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(240, 230, 255, 0.7);
    letter-spacing: 0.02em;
    margin: 0;
    max-width: 480px;
}

/* Left column */
.lp-hero-left {
    animation: fadeInUp 0.6s ease-out;
}

.lp-brand {
    display: flex;
    align-items: center;
    gap: var(--l2h-space-md);
    margin-bottom: var(--l2h-space-xl);
}

.lp-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    animation: logoPulse 3s ease-in-out infinite;
}

.lp-brand-name {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--l2h-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-headline {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 var(--l2h-space-lg) 0;
    letter-spacing: -1px;
}

.lp-subheadline {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--l2h-text-secondary);
    margin: 0 0 var(--l2h-space-xl) 0;
    max-width: 500px;
}

/* Stat badges row */
.lp-stat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--l2h-space-sm);
    margin-bottom: var(--l2h-space-xl);
}

.lp-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--l2h-radius-full);
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--l2h-gold-light);
}

.lp-stat-badge .mud-icon-root {
    font-size: 1rem;
    color: var(--l2h-gold);
}

/* Explore link */
.lp-explore-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--l2h-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--l2h-transition-fast);
}

.lp-explore-link:hover {
    color: var(--l2h-gold);
}

.lp-explore-link .mud-icon-root {
    font-size: 1.25rem;
}

/* Right column */
.lp-hero-right {
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

/* Login card (glassmorphism + portal glow) */
.lp-login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(14, 2, 22, 0.88);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(76, 168, 255, 0.3);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 0 30px rgba(76, 168, 255, 0.15),
                0 0 60px rgba(139, 92, 246, 0.1);
    transition: border-color var(--l2h-transition-normal),
                box-shadow var(--l2h-transition-normal);
}

.lp-login-card:hover {
    border-color: rgba(76, 168, 255, 0.5);
    box-shadow: 0 0 40px rgba(76, 168, 255, 0.25),
                0 0 80px rgba(139, 92, 246, 0.15);
}

/* Brand inside card */
.lp-card-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lp-card-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    animation: logoPulse 3s ease-in-out infinite;
}


.lp-login-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--l2h-text-primary);
    margin: 0 0 24px 0;
    text-align: center;
}

/* Form styles (shared with login card) */
.login-error {
    display: flex;
    align-items: center;
    gap: var(--l2h-space-sm);
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: var(--l2h-radius-md);
    padding: var(--l2h-space-sm) var(--l2h-space-md);
    margin-bottom: var(--l2h-space-md);
    color: #f44336;
    font-size: 0.875rem;
}

.login-error .mud-icon-root {
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.login-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--l2h-text-secondary);
}

.login-field input {
    width: 100%;
    background: rgba(14, 2, 22, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--l2h-radius-md);
    padding: 14px 16px;
    color: var(--l2h-text-primary);
    font-size: 1rem;
    transition: border-color var(--l2h-transition-fast),
                box-shadow var(--l2h-transition-fast),
                background-color var(--l2h-transition-fast);
    box-sizing: border-box;
}

.login-field input:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(14, 2, 22, 1);
}

.login-field input:focus {
    outline: none;
    border-color: var(--l2h-gold);
    box-shadow: 0 0 0 3px rgba(76, 168, 255, 0.15), 0 0 0 6px rgba(139, 92, 246, 0.1);
    background: rgba(14, 2, 22, 1);
}

.login-field input::placeholder {
    color: var(--l2h-text-muted);
}

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(14, 2, 22, 0.95) inset !important;
    -webkit-text-fill-color: var(--l2h-text-primary) !important;
    border-color: rgba(139, 92, 246, 0.3);
    transition: background-color 5000s ease-in-out 0s;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-checkbox {
    display: flex;
    align-items: center;
    gap: var(--l2h-space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--l2h-text-primary);
    user-select: none;
}

.login-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 1.5px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    background: rgba(14, 2, 22, 0.8);
    transition: all var(--l2h-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-custom::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--l2h-gold);
    border-radius: 2px;
    opacity: 0;
    transform: scale(0);
    transition: all var(--l2h-transition-fast);
}

.login-checkbox input:checked + .checkbox-custom {
    border-color: var(--l2h-gold);
}

.login-checkbox input:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.login-checkbox:hover .checkbox-custom {
    border-color: rgba(255, 255, 255, 0.3);
}

.login-submit-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: var(--l2h-space-sm);
    background: linear-gradient(135deg, var(--l2h-gold) 0%, var(--l2h-gold-dark) 100%);
    border: none;
    border-radius: var(--l2h-radius-md);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--l2h-transition-fast),
                box-shadow var(--l2h-transition-fast);
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        -45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    transform: translateX(-100%) skewX(-15deg);
    pointer-events: none;
}

.login-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(76, 168, 255, 0.35);
}

.login-submit-btn:hover:not(:disabled)::before {
    animation: buttonShine 0.6s ease-out;
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--l2h-space-sm);
}

.login-submit-btn.loading .btn-text {
    display: none;
}

.login-submit-btn.loading .btn-loading {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* -------------------------------------------------------------------------
   Shared section styles
   ------------------------------------------------------------------------- */
.lp-section {
    padding: 80px var(--l2h-space-xl);
}

.lp-container {
    max-width: 1100px;
    margin: 0 auto;
}

.lp-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 var(--l2h-space-sm) 0;
}

.lp-section-subtitle {
    font-size: 1.05rem;
    color: var(--l2h-text-muted);
    text-align: center;
    margin: 0 0 var(--l2h-space-2xl) 0;
}

/* -------------------------------------------------------------------------
   Section 2: Feature Highlights — 3x2 Grid
   ------------------------------------------------------------------------- */
.lp-features {
    background: var(--l2h-bg-base);
}

.lp-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--l2h-space-lg);
}

.lp-feature-card {
    background: var(--l2h-bg-surface);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: var(--l2h-radius-lg);
    padding: var(--l2h-space-xl);
    transition: transform var(--l2h-transition-normal),
                border-color var(--l2h-transition-normal),
                box-shadow var(--l2h-transition-normal);
}

.lp-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 30px rgba(14, 2, 22, 0.4),
                0 0 20px rgba(139, 92, 246, 0.12);
}

.lp-feature-icon {
    margin-bottom: var(--l2h-space-md);
    color: var(--l2h-gold);
}

.lp-feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 var(--l2h-space-sm) 0;
}

.lp-feature-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--l2h-text-secondary);
    margin: 0;
}

/* -------------------------------------------------------------------------
   Section 3: How It Works — 3-Step Flow
   ------------------------------------------------------------------------- */
.lp-how-it-works {
    background: linear-gradient(180deg, var(--l2h-bg-base) 0%, var(--l2h-bg-surface) 50%, var(--l2h-bg-base) 100%);
}

.lp-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-top: var(--l2h-space-2xl);
}

.lp-step {
    text-align: center;
    flex: 0 0 220px;
}

.lp-step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--l2h-void);
    background: rgba(139, 92, 246, 0.1);
    animation: voidCrystalGlow 4s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--l2h-void-light);
    margin: 0 auto var(--l2h-space-md) auto;
}

.lp-step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 var(--l2h-space-xs) 0;
}

.lp-step p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--l2h-text-secondary);
    margin: 0;
}

.lp-step-connector {
    flex: 0 0 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--l2h-void) 0%, rgba(139, 92, 246, 0.2) 100%);
    margin-top: 28px; /* vertically center with step-number */
}

/* -------------------------------------------------------------------------
   Section 4: Supported Specs — Role-grouped Badge Rows
   ------------------------------------------------------------------------- */
.lp-specs {
    background: var(--l2h-bg-base);
}

/* Role group wrapper — one per role (Healers / DPS / Tanks) */
.lp-spec-role-group {
    margin-top: var(--l2h-space-2xl);
}

.lp-spec-role-group:first-of-type {
    margin-top: var(--l2h-space-xl);
}

.lp-spec-role-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--l2h-space-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--l2h-text-muted);
    margin: 0 0 var(--l2h-space-md) 0;
}

.lp-spec-role-icon {
    font-size: 1rem !important;
    opacity: 0.6;
}

.lp-spec-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--l2h-space-md);
}

.lp-spec-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--l2h-space-sm);
    background: var(--l2h-bg-surface);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: var(--l2h-radius-full);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--l2h-text-primary);
    transition: transform var(--l2h-transition-fast),
                border-color var(--l2h-transition-fast),
                box-shadow var(--l2h-transition-fast);
}

.lp-spec-badge:hover {
    transform: translateY(-2px);
}

/* Healer specs */
.lp-spec-badge[data-class="priest"]:hover {
    border-color: var(--l2h-class-priest);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.lp-spec-badge[data-class="paladin"]:hover {
    border-color: var(--l2h-class-paladin);
    box-shadow: 0 0 12px rgba(245, 140, 186, 0.2);
}

.lp-spec-badge[data-class="shaman"]:hover {
    border-color: var(--l2h-class-shaman);
    box-shadow: 0 0 12px rgba(0, 112, 222, 0.2);
}

.lp-spec-badge[data-class="druid"]:hover {
    border-color: var(--l2h-class-druid);
    box-shadow: 0 0 12px rgba(255, 125, 10, 0.2);
}

.lp-spec-badge[data-class="monk"]:hover {
    border-color: var(--l2h-class-monk);
    box-shadow: 0 0 12px rgba(0, 255, 150, 0.15);
}

.lp-spec-badge[data-class="evoker"]:hover {
    border-color: var(--l2h-class-evoker);
    box-shadow: 0 0 12px rgba(51, 147, 127, 0.2);
}

/* DPS & tank specs */
.lp-spec-badge[data-class="mage"]:hover {
    border-color: var(--l2h-class-mage);
    box-shadow: 0 0 12px rgba(64, 199, 235, 0.2);
}

.lp-spec-badge[data-class="warlock"]:hover {
    border-color: var(--l2h-class-warlock);
    box-shadow: 0 0 12px rgba(135, 135, 237, 0.2);
}

.lp-spec-badge[data-class="hunter"]:hover {
    border-color: var(--l2h-class-hunter);
    box-shadow: 0 0 12px rgba(171, 212, 115, 0.2);
}

.lp-spec-badge[data-class="rogue"]:hover {
    border-color: var(--l2h-class-rogue);
    box-shadow: 0 0 12px rgba(255, 245, 105, 0.15);
}

.lp-spec-badge[data-class="warrior"]:hover {
    border-color: var(--l2h-class-warrior);
    box-shadow: 0 0 12px rgba(199, 156, 110, 0.2);
}

.lp-spec-badge[data-class="deathknight"]:hover {
    border-color: var(--l2h-class-deathknight);
    box-shadow: 0 0 12px rgba(196, 31, 59, 0.2);
}

.lp-spec-badge[data-class="demonhunter"]:hover {
    border-color: var(--l2h-class-demonhunter);
    box-shadow: 0 0 12px rgba(163, 48, 201, 0.2);
}

.lp-spec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

/* Colored glow per class */
.lp-spec-badge[data-class="priest"] .lp-spec-dot { box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }
.lp-spec-badge[data-class="paladin"] .lp-spec-dot { box-shadow: 0 0 8px rgba(245, 140, 186, 0.5); }
.lp-spec-badge[data-class="shaman"] .lp-spec-dot { box-shadow: 0 0 8px rgba(0, 112, 222, 0.5); }
.lp-spec-badge[data-class="druid"] .lp-spec-dot { box-shadow: 0 0 8px rgba(255, 125, 10, 0.5); }
.lp-spec-badge[data-class="monk"] .lp-spec-dot { box-shadow: 0 0 8px rgba(0, 255, 150, 0.4); }
.lp-spec-badge[data-class="evoker"] .lp-spec-dot { box-shadow: 0 0 8px rgba(51, 147, 127, 0.5); }
.lp-spec-badge[data-class="mage"] .lp-spec-dot { box-shadow: 0 0 8px rgba(64, 199, 235, 0.5); }
.lp-spec-badge[data-class="warlock"] .lp-spec-dot { box-shadow: 0 0 8px rgba(135, 135, 237, 0.5); }
.lp-spec-badge[data-class="hunter"] .lp-spec-dot { box-shadow: 0 0 8px rgba(171, 212, 115, 0.5); }
.lp-spec-badge[data-class="rogue"] .lp-spec-dot { box-shadow: 0 0 8px rgba(255, 245, 105, 0.4); }
.lp-spec-badge[data-class="warrior"] .lp-spec-dot { box-shadow: 0 0 8px rgba(199, 156, 110, 0.5); }
.lp-spec-badge[data-class="deathknight"] .lp-spec-dot { box-shadow: 0 0 8px rgba(196, 31, 59, 0.5); }
.lp-spec-badge[data-class="demonhunter"] .lp-spec-dot { box-shadow: 0 0 8px rgba(163, 48, 201, 0.5); }

/* -------------------------------------------------------------------------
   Section 5: By the Numbers + Capabilities
   ------------------------------------------------------------------------- */
.lp-capabilities {
    background: linear-gradient(180deg, var(--l2h-bg-base) 0%, var(--l2h-bg-surface) 100%);
}

.lp-big-stats {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-bottom: var(--l2h-space-2xl);
}

.lp-big-stat {
    text-align: center;
}

.lp-big-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--l2h-gold);
    line-height: 1;
    margin-bottom: var(--l2h-space-xs);
}

.lp-big-label {
    font-size: 0.9rem;
    color: var(--l2h-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.lp-capability-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--l2h-space-lg) 60px;
    max-width: 800px;
    margin: 0 auto;
}

.lp-capability-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--l2h-space-md);
}

.lp-capability-list li {
    display: flex;
    align-items: center;
    gap: var(--l2h-space-sm);
    font-size: 0.95rem;
    color: var(--l2h-text-secondary);
}

.lp-bullet {
    color: var(--l2h-gold);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Section 6: Bottom CTA + Footer
   ------------------------------------------------------------------------- */
.lp-cta {
    background: var(--l2h-bg-base);
    text-align: center;
}

.lp-cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lp-cta-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: var(--l2h-space-lg);
    opacity: 0.9;
}

.lp-cta-headline {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 var(--l2h-space-lg) 0;
}

.lp-cta-button {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--l2h-gold) 0%, var(--l2h-gold-dark) 100%);
    border-radius: var(--l2h-radius-md);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform var(--l2h-transition-fast),
                box-shadow var(--l2h-transition-fast);
}

.lp-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(76, 168, 255, 0.35);
    color: #fff;
    text-decoration: none;
}

.lp-footer {
    padding: var(--l2h-space-lg) var(--l2h-space-xl);
    text-align: center;
    background: var(--l2h-bg-base);
    border-top: 1px solid rgba(139, 92, 246, 0.08);
}

.lp-footer p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--l2h-text-muted);
}

/* ==========================================================================
   Landing Page Responsive
   ========================================================================== */

/* Tablet: features go 2-col, steps stay horizontal */
@media (max-width: 960px) {
    .lp-hero-grid {
        grid-template-columns: 1fr;
        gap: var(--l2h-space-xl);
        padding: var(--l2h-space-xl) var(--l2h-space-md);
    }

    .lp-hero-centered {
        padding: var(--l2h-space-lg) var(--l2h-space-md);
    }

    .lp-hero-left {
        text-align: center;
    }

    .lp-brand {
        justify-content: center;
    }

    .lp-subheadline {
        max-width: 100%;
    }

    .lp-stat-badges {
        justify-content: center;
    }

    .lp-explore-link {
        justify-content: center;
    }

    .lp-headline {
        font-size: 2.25rem;
    }

    .lp-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lp-big-stats {
        gap: 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .lp-section {
        padding: 56px var(--l2h-space-md);
    }

    .lp-section-title {
        font-size: 1.5rem;
    }

    .lp-feature-grid {
        grid-template-columns: 1fr;
    }

    .lp-steps {
        flex-direction: column;
        align-items: center;
        gap: var(--l2h-space-md);
    }

    .lp-step {
        flex: none;
        width: 100%;
        max-width: 300px;
    }

    .lp-step-connector {
        width: 2px;
        height: 30px;
        flex: none;
        margin-top: 0;
        background: linear-gradient(180deg, var(--l2h-void) 0%, rgba(139, 92, 246, 0.2) 100%);
    }

    .lp-big-stats {
        flex-direction: column;
        gap: var(--l2h-space-xl);
        align-items: center;
    }

    .lp-big-number {
        font-size: 2.75rem;
    }

    .lp-capability-grid {
        grid-template-columns: 1fr;
        gap: var(--l2h-space-md);
    }

    .lp-cta-headline {
        font-size: 1.4rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .lp-hero-grid {
        padding: var(--l2h-space-lg) var(--l2h-space-md);
    }

    .lp-hero-centered {
        padding: var(--l2h-space-md) var(--l2h-space-sm);
    }

    .lp-headline {
        font-size: 1.85rem;
    }

    .lp-login-card {
        padding: var(--l2h-space-lg);
    }

    .lp-stat-badge {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

/* ==========================================================================
   Landing Page Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .lp-brand-logo,
    .lp-card-brand-logo {
        animation: none;
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
    }

    .particle {
        display: none;
    }

    .login-submit-btn::before {
        display: none;
    }

    .lp-hero-left,
    .lp-hero-right,
    .lp-hero-centered {
        animation: none;
    }

    .lp-animate-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .lp-feature-card,
    .lp-spec-badge,
    .lp-cta-button {
        transition: none;
    }
}

/* ==========================================================================
   Panel Enrichment: Spell Breakdown, Activity/Mana, Buff Uptimes, DPS
   ========================================================================== */

/* Spell Breakdown */
.panel-spell-breakdown {
    margin-top: var(--l2h-space-sm);
}

.spell-bar-row {
    display: grid;
    grid-template-columns: minmax(80px, 120px) 1fr 48px 52px;
    align-items: center;
    gap: var(--l2h-space-sm);
    margin-bottom: 6px;
}

.spell-bar-label {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spell-bar-label .spell-link {
    color: var(--l2h-text-primary);
    text-decoration: none;
}

.spell-bar-label .spell-link:hover {
    color: var(--l2h-gold);
    text-decoration: underline;
}

.spell-bar-track {
    height: 12px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--l2h-radius-full);
    overflow: hidden;
}

.spell-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--l2h-gold-dark) 0%, var(--l2h-gold) 100%);
    border-radius: var(--l2h-radius-full);
    transition: width var(--l2h-transition-normal);
    min-width: 2px;
}

.spell-bar-fill.damage-fill {
    background: linear-gradient(90deg, #c41e3a, #ff4444);
}

.spell-bar-pct {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
    color: var(--l2h-text-primary);
}

.spell-bar-oh {
    font-size: 0.7rem;
    text-align: right;
}

/* Activity & Mana */
.panel-activity-mana {
    display: flex;
    gap: var(--l2h-space-sm);
    margin-top: var(--l2h-space-md);
}

.panel-activity-mana .analysis-stat-card {
    flex: 1 1 0;
    min-width: 0;
}

/* Key Buff Uptimes */
.panel-key-buff-uptimes {
    margin-top: var(--l2h-space-md);
}

.buff-uptime-row {
    display: grid;
    grid-template-columns: minmax(80px, 120px) 1fr 80px;
    align-items: center;
    gap: var(--l2h-space-sm);
    margin-bottom: 6px;
}

.buff-uptime-label {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buff-uptime-label .spell-link {
    color: var(--l2h-text-primary);
    text-decoration: none;
}

.buff-uptime-label .spell-link:hover {
    color: var(--l2h-gold);
    text-decoration: underline;
}

.buff-uptime-value {
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
}

/* Healer DPS */
.panel-healer-dps {
    margin-top: var(--l2h-space-md);
}

/* ==========================================================================
   Top Performer Comparison (aligned with enrichment panel style)
   ========================================================================== */

/* HPS Comparison Bars */
.comp-hps-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comp-hps-row {
    display: grid;
    grid-template-columns: 60px 1fr 70px;
    align-items: center;
    gap: var(--l2h-space-sm);
}

.comp-hps-label {
    font-size: 0.8rem;
    font-weight: 500;
}

.comp-hps-value {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
}

/* Top performer bar fill — muted gray to contrast with gold user bar */
.comp-hps-fill-top {
    height: 100%;
    background: rgba(139, 92, 246, 0.3);
    border-radius: var(--l2h-radius-full);
    transition: width var(--l2h-transition-normal);
    min-width: 2px;
}

/* Spell Difference Comparison Rows */
.comp-spell-row {
    display: grid;
    grid-template-columns: minmax(80px, 120px) 1fr 70px 52px;
    align-items: center;
    gap: var(--l2h-space-sm);
    margin-bottom: 6px;
}

.comp-spell-bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comp-spell-track {
    height: 8px;
}

.comp-spell-values {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    text-align: right;
    line-height: 1.3;
}

.comp-spell-diff {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}

.comp-diff-positive {
    color: var(--l2h-success);
}

.comp-diff-negative {
    color: var(--l2h-error);
}

/* Shared Comparison Legend */
.comp-legend {
    display: flex;
    gap: var(--l2h-space-md);
    font-size: 0.75rem;
    color: var(--l2h-text-muted);
}

.comp-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.comp-legend-marker {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: var(--l2h-radius-full);
}

.comp-legend-user {
    background: var(--l2h-gold);
    box-shadow: 0 0 4px rgba(76, 168, 255, 0.4);
}

.comp-legend-top {
    background: rgba(139, 92, 246, 0.25);
    border: 1.5px solid rgba(139, 92, 246, 0.4);
}

/* Cooldown Timing Comparison */
.cd-insight-list {
    margin: 0;
    padding-left: 20px;
}

.cd-insight-list li {
    margin-bottom: 4px;
}

.cd-entries {
    display: flex;
    flex-direction: column;
    gap: var(--l2h-space-md);
}

.cd-entry {
    background: var(--l2h-bg-base);
    border-radius: var(--l2h-radius-sm);
    padding: var(--l2h-space-sm) var(--l2h-space-md);
}

.cd-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--l2h-space-sm);
    flex-wrap: wrap;
    gap: var(--l2h-space-sm);
}

.cd-entry-stats {
    display: flex;
    align-items: center;
    gap: var(--l2h-space-sm);
}

.cd-stat-item {
    font-size: 0.8rem;
}

.cd-timeline {
    margin-top: var(--l2h-space-xs);
}

.cd-timeline-track {
    position: relative;
    height: 20px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--l2h-radius-full);
    overflow: visible;
}

.cd-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform var(--l2h-transition-fast);
    z-index: 1;
}

.cd-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 10;
}

.cd-marker-user {
    background: var(--l2h-gold);
    box-shadow: 0 0 4px rgba(76, 168, 255, 0.5);
    z-index: 2;
}

.cd-marker-top {
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.4);
    width: 14px;
    height: 14px;
}

.cd-timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--l2h-text-muted);
    margin-top: 2px;
}

/* Talent & Trinket Comparison Tables */
.talent-diff-table .spell-link,
.trinket-comp-table .spell-link {
    color: var(--l2h-text-primary);
    text-decoration: none;
}

.talent-diff-table .spell-link:hover,
.trinket-comp-table .spell-link:hover {
    color: var(--l2h-gold);
    text-decoration: underline;
}

/* Wowhead auto-injected icons in trinket table */
.trinket-comp-table .iconsmall {
    vertical-align: middle;
    margin-right: 4px;
}

/* ==========================================================================
   Global Navigation Sidebar
   ========================================================================== */

/* Sidebar drawer styling */
.l2h-sidebar {
    width: var(--l2h-sidebar-width) !important;
}

.l2h-sidebar .mud-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden;
}

/* Prevent horizontal scroll in nav menu */
.l2h-sidebar .mud-navmenu {
    overflow-x: hidden;
}

/* Desktop: CharacterSubNav shifts right when sidebar is open */
@media (min-width: 960px) {
    /* MudBlazor adds mud-drawer-open-responsive-md-left class to layout when drawer is open */
    .mud-layout.mud-drawer-open-responsive-md-left .character-subnav {
        left: var(--l2h-sidebar-width);
    }

    /* Smooth transition for subnav positioning */
    .character-subnav {
        transition: left 0.2s ease;
    }
}

/* Mobile: sidebar as overlay, subnav stays full width */
@media (max-width: 959.98px) {
    .character-subnav {
        left: 0;
    }
}

/* ==========================================================================
   Midnight Expansion Animations
   ========================================================================== */

@keyframes cosmicDrift {
    0% { background-position: 0% 0%; }
    25% { background-position: 50% 25%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 75%; }
    100% { background-position: 0% 0%; }
}

@keyframes voidShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes voidPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes voidCrystalGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(139, 92, 246, 0.2),
                    0 0 16px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow: 0 0 16px rgba(139, 92, 246, 0.35),
                    0 0 32px rgba(139, 92, 246, 0.15);
    }
}

/* Disable new animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lp-step-number {
        animation: none;
    }
}

/* ==========================================================================
   Death Recap Timeline
   ========================================================================== */

/* Section 1: Header */
.death-recap-header {
    padding: var(--l2h-space-sm) var(--l2h-space-md);
    background: var(--l2h-bg-surface);
    border-radius: var(--l2h-radius-md);
    border: var(--l2h-border-subtle);
}

/* Section 2: HP Sparkline */
.hp-sparkline-container {
    background: var(--l2h-bg-surface);
    border-radius: var(--l2h-radius-md);
    border: var(--l2h-border-subtle);
    padding: var(--l2h-space-sm) var(--l2h-space-md);
}

.hp-sparkline-svg {
    width: 100%;
    height: 80px;
    display: block;
}

.hp-sparkline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--l2h-text-muted);
    font-family: monospace;
    margin-top: 2px;
}

/* Section 3: Kill Sequence */
.kill-sequence-panel {
    border: 2px solid var(--l2h-error);
    border-radius: var(--l2h-radius-md);
    overflow: hidden;
    background: var(--l2h-bg-surface);
}

.kill-sequence-header {
    display: flex;
    align-items: center;
    padding: var(--l2h-space-xs) var(--l2h-space-md);
    background: rgba(244, 67, 54, 0.08);
    border-bottom: 1px solid rgba(244, 67, 54, 0.2);
}

.kill-sequence-table,
.death-recap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.kill-sequence-table thead th,
.death-recap-table thead th {
    text-align: left;
    padding: var(--l2h-space-xs) var(--l2h-space-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--l2h-text-muted);
    border-bottom: var(--l2h-border-subtle);
    white-space: nowrap;
}

.kill-sequence-table tbody tr,
.death-recap-table tbody tr {
    border-bottom: 1px solid rgba(139, 92, 246, 0.06);
}

.kill-sequence-table tbody tr:hover,
.death-recap-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.04);
}

.kill-sequence-table td,
.death-recap-table td {
    padding: 3px var(--l2h-space-sm);
    vertical-align: middle;
}

/* Killing blow row */
.killing-blow-row {
    background: rgba(244, 67, 54, 0.12) !important;
}

.killing-blow-row td {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Category indicator dot */
.category-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-dot.recap-damage { background: var(--l2h-error); }
.category-dot.recap-healing { background: var(--l2h-success); }
.category-dot.recap-defensive { background: var(--l2h-warning); }
.category-dot.recap-external { background: var(--l2h-gold); }
.category-dot.recap-debuff { background: var(--l2h-void); }

/* Shared event table styles */
.recap-event-time {
    font-size: 0.7rem;
    color: var(--l2h-text-muted);
    font-family: monospace;
    white-space: nowrap;
}

.event-ability-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.recap-ability-link {
    font-size: 0.8rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recap-hit-badge {
    font-size: 0.65rem;
    color: var(--l2h-text-muted);
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--l2h-radius-full);
    padding: 0 4px;
    white-space: nowrap;
}

.recap-event-amount {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
}

.recap-event-amount.recap-damage { color: var(--l2h-error); }
.recap-event-amount.recap-healing { color: var(--l2h-success); }
.recap-event-amount.recap-defensive { color: var(--l2h-warning); }
.recap-event-amount.recap-external { color: var(--l2h-gold); }
.recap-event-amount.recap-debuff { color: var(--l2h-void); }

/* Source column */
.recap-source-col {
    width: 110px;
}

.recap-source-name {
    font-size: 0.75rem;
    color: var(--l2h-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

/* Mini HP bar (inline in table cells) */
.mini-hp-bar {
    position: relative;
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    min-width: 50px;
}

.mini-hp-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s ease;
}

.mini-hp-fill.hp-high { background: var(--l2h-success); opacity: 0.6; }
.mini-hp-fill.hp-mid  { background: var(--l2h-warning); opacity: 0.6; }
.mini-hp-fill.hp-low  { background: var(--l2h-error); opacity: 0.6; }

.mini-hp-text {
    position: absolute;
    top: 0;
    right: 3px;
    font-size: 0.6rem;
    line-height: 14px;
    color: var(--l2h-text-secondary);
    font-weight: 600;
}

/* Section 4: Damage Summary Bar */
.damage-summary-section {
    background: var(--l2h-bg-surface);
    border-radius: var(--l2h-radius-md);
    border: var(--l2h-border-subtle);
    padding: var(--l2h-space-sm) var(--l2h-space-md);
}

.damage-summary-bar {
    display: flex;
    height: 20px;
    border-radius: var(--l2h-radius-sm);
    overflow: hidden;
    gap: 1px;
}

.damage-bar-segment {
    transition: opacity 0.15s;
    cursor: default;
    min-width: 3px;
}

.damage-bar-segment:hover {
    opacity: 0.8;
}

.damage-summary-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--l2h-space-sm) var(--l2h-space-md);
    margin-top: var(--l2h-space-xs);
}

.damage-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.damage-legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Section 5: Full Event Log */
.death-recap-full-log {
    border: var(--l2h-border-subtle);
    border-radius: var(--l2h-radius-md);
}

.death-recap-full-log .mud-expand-panel {
    background: var(--l2h-bg-surface) !important;
}

.death-recap-full-log .mud-expand-panel-header {
    padding: var(--l2h-space-sm) var(--l2h-space-md) !important;
}

.collapsed-event-row {
    cursor: pointer;
    background: rgba(139, 92, 246, 0.03);
}

.collapsed-event-row:hover {
    background: rgba(139, 92, 246, 0.08) !important;
}

.collapsed-event-cell {
    padding: var(--l2h-space-xs) var(--l2h-space-sm) !important;
}

.group-child-row {
    background: rgba(76, 175, 80, 0.03);
}

.group-child-row td {
    padding-left: calc(var(--l2h-space-sm) + 8px) !important;
}

/* Kill Window Selector (inline in kill-sequence-header) */
.kill-window-selector {
    margin-left: auto;
}

.kill-window-select {
    max-width: 200px;
    min-width: 160px;
}

/* Defensive Analysis Panel */
.defensive-panel {
    background: var(--l2h-bg-surface);
    border-radius: var(--l2h-radius-md);
    border: 1px solid rgba(255, 152, 0, 0.25);
    overflow: hidden;
}

.defensive-panel-header {
    display: flex;
    align-items: center;
    padding: var(--l2h-space-xs) var(--l2h-space-md);
    background: rgba(255, 152, 0, 0.08);
    border-bottom: 1px solid rgba(255, 152, 0, 0.15);
}

.defensive-panel-body {
    padding: var(--l2h-space-sm) var(--l2h-space-md);
    display: flex;
    flex-direction: column;
    gap: var(--l2h-space-sm);
}

.defensive-row {
    display: flex;
    align-items: center;
    gap: var(--l2h-space-sm);
}

.defensive-row-label {
    min-width: 140px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--l2h-text-secondary);
    font-weight: 500;
}

.defensive-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.defensive-source-name {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 2px;
}

/* =========================================================================
   Talent Tree SVG Visualization
   ========================================================================= */

.talent-tree-container {
    margin-top: var(--l2h-space-sm);
}

.talent-tree-tabs.mud-tabs {
    overflow: visible !important;
}

.talent-tree-tabs .mud-tabs-panels {
    background: transparent !important;
    padding: 0 !important;
    overflow: visible !important;
}

.talent-tree-tabs .mud-tab {
    min-width: 80px;
    font-size: 0.8rem;
    text-transform: none;
}

/* Wrapper that holds SVG + tooltip overlay in the same stacking context */
.talent-section-wrapper {
    position: relative;
    overflow: visible;
}

.talent-tree-svg {
    width: 100%;
    max-height: 650px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: var(--l2h-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: visible;
    display: block; /* prevent inline spacing */
}

/* Edges */
.talent-edge {
    stroke: #3a3a3a;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.talent-edge.active {
    stroke: rgba(255, 215, 0, 0.6);
    stroke-width: 2;
}

/* Nodes */
.talent-node {
    cursor: pointer;
    transition: filter 0.15s ease;
}

.talent-node:hover circle,
.talent-node:hover polygon {
    stroke-width: 3;
    filter: brightness(1.3);
}

.talent-node:hover {
    filter: brightness(1.1);
}

/* Correct nodes - subtle gold glow on hover */
.talent-node.correct:hover {
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}

/* Usage percentage text below node */
.talent-node .usage-pct {
    font-size: 8px;
    fill: #aaa;
    text-anchor: middle;
    font-family: 'Segoe UI', system-ui, sans-serif;
    pointer-events: none;
}

/* Rank indicator text */
.talent-node .rank-text {
    font-size: 7px;
    fill: #ffd700;
    text-anchor: middle;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    pointer-events: none;
}

/* Missing node pulsing glow animation */
.talent-node.missing circle,
.talent-node.missing polygon {
    animation: talent-pulse-glow 2.5s ease-in-out infinite;
}

@keyframes talent-pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(244, 67, 54, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(244, 67, 54, 0.8));
    }
}

/* Legend */
.talent-tree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--l2h-space-md);
    justify-content: center;
    padding: var(--l2h-space-xs) 0;
    margin-top: var(--l2h-space-xs);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--l2h-text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid;
    display: inline-block;
}

.legend-dot-pulse {
    animation: talent-pulse-glow 2.5s ease-in-out infinite;
}

/* Drop node - orange border for talents to consider dropping */
.talent-node.drop circle,
.talent-node.drop polygon {
    filter: drop-shadow(0 0 2px rgba(255, 152, 0, 0.4));
}

/* Neutral nodes - dimmed appearance */
.talent-node.neutral {
    opacity: 0.55;
}

/* =========================================================================
   Talent Summary Bar
   ========================================================================= */

.talent-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--l2h-space-sm);
    justify-content: center;
    padding: var(--l2h-space-xs) 0;
    margin-bottom: var(--l2h-space-sm);
}

.talent-summary-bar .mud-chip {
    font-size: 0.75rem;
    font-weight: 500;
}

/* =========================================================================
   Talent Hover Card (custom coaching tooltip)
   ========================================================================= */

.talent-hover-card {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    transform: translateY(-50%);
    background: rgba(20, 8, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--l2h-radius-md);
    padding: 12px;
    max-width: 280px;
    min-width: 220px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.thc-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.thc-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.thc-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.thc-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--l2h-text-primary);
    line-height: 1.2;
}

.thc-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--l2h-radius-full);
    width: fit-content;
}

.thc-badge-has {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.thc-badge-missing {
    background: rgba(150, 150, 150, 0.15);
    color: #999;
    border: 1px solid rgba(150, 150, 150, 0.2);
}

/* Usage bar */
.thc-usage {
    margin-bottom: 8px;
}

.thc-usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--l2h-text-muted);
    margin-bottom: 3px;
}

.thc-usage-pct {
    font-weight: 600;
    color: var(--l2h-text-primary);
}

.thc-usage-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.thc-usage-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Recommendation text */
.thc-recommendation {
    font-size: 0.72rem;
    color: var(--l2h-text-secondary);
    line-height: 1.3;
    padding: 4px 0;
}

.thc-recommendation.missing {
    color: #f44336;
    font-weight: 500;
}

.thc-recommendation.drop {
    color: #ff9800;
    font-weight: 500;
}

.thc-recommendation.correct {
    color: #22c55e;
}

/* Choice node options */
.thc-choice-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.thc-choice-label {
    font-size: 0.68rem;
    color: var(--l2h-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.thc-choice-option {
    padding: 4px 6px;
    border-radius: var(--l2h-radius-sm);
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.thc-choice-option.selected {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.thc-choice-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.thc-choice-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.thc-choice-name {
    font-size: 0.72rem;
    color: var(--l2h-text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thc-choice-badge {
    font-size: 0.6rem;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    padding: 0 4px;
    border-radius: var(--l2h-radius-full);
    flex-shrink: 0;
}

.thc-choice-bar {
    margin-bottom: 2px;
}

.thc-choice-pct {
    font-size: 0.65rem;
    color: var(--l2h-text-muted);
}

/* Compared Against - Inline Performer Links */
.compared-against-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
}

.compared-against-inline > :first-child {
    margin-right: 2px;
}

/* =========================================================================
   Raid Health Timeline - Background graph on fight timelines
   ========================================================================= */

.raid-health-backdrop {
    position: absolute;
    top: 20px;
    left: 60px;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
}

.raid-health-backdrop-dialog {
    position: absolute;
    top: 24px;
    left: 160px;
    right: 0;
    bottom: 40px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

.raid-health-svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}
