/* Theme Variables */
:root, .theme-dark {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --hover-color: #475569;
    --accent-glow: rgba(99, 102, 241, 0.3);
}

.theme-light {
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
    --hover-color: #e2e8f0;
    --accent-glow: rgba(79, 70, 229, 0.2);
}

.theme-candy {
    --primary-color: #ec4899;
    --secondary-color: #a855f7;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #1a0a1f;
    --card-bg: #2d1b3d;
    --text-color: #fce7f3;
    --text-secondary: #f9a8d4;
    --border-color: #831843;
    --hover-color: #9d174d;
    --accent-glow: rgba(236, 72, 153, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #020617 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.theme-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.theme-dark .theme-icon::before {
    content: '🌙';
}

.theme-light .theme-icon::before {
    content: '☀️';
}

.theme-candy .theme-icon::before {
    content: '🍭';
}

.theme-horde .theme-icon::before {
    content: '⚔️';
}

.theme-alliance .theme-icon::before {
    content: '🛡️';
}

.theme-classic .theme-icon::before {
    content: '🏰';
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header with gradient and glow effect */
header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4),
                0 0 100px var(--accent-glow);
    position: relative;
    overflow: hidden;
    border-top: 6px solid #d4af37;
    border-bottom: 6px solid #d4af37;
}

/* Decorative corner ornaments */
header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #d4af37 0px,
        #d4af37 20px,
        transparent 20px,
        transparent 40px
    );
    z-index: 2;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: white;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 2px;
}

header h1::before {
    content: '⚔️ ';
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

header h1::after {
    content: ' ⚔️';
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    color: white;
    position: relative;
    z-index: 1;
}

.version {
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
    margin-top: 10px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.header-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.donate-btn-container {
    display: inline-flex;
    align-items: center;
}

.donate-btn-container img {
    height: 40px;
    width: auto;
    border-radius: 6px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    vertical-align: middle;
}

.donate-btn-container img:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.guild-link,
.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.guild-link:hover,
.admin-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.admin-link {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.admin-link:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.5);
}

.section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
                0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
                0 0 2px rgba(255, 255, 255, 0.2);
}

.section h2 {
    color: var(--primary-color);
    margin-bottom: 24px;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    margin: 0;
}

/* Status Messages — fixed toast, never shifts layout */
.status-message {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 500;
    align-items: center;
    gap: 12px;
    animation: slideInUp 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    min-width: 280px;
    max-width: 90vw;
    white-space: nowrap;
}

@keyframes slideInUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.status-message::before {
    font-size: 1.5rem;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.status-message.success::before {
    content: '✓';
}

.status-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.status-message.error::before {
    content: '⚠';
}

/* Enhanced Upload Controls */
.upload-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

input[type="file"] {
    flex: 1;
    min-width: 250px;
    padding: 14px 18px;
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

input[type="text"] {
    padding: 14px 18px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 14px;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
    padding: 14px 18px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

select:hover {
    border-color: var(--primary-color);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Enhanced Buttons */
button {
    padding: 14px 28px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--border-color);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--hover-color);
    box-shadow: 0 6px 20px rgba(71, 85, 105, 0.4);
}

.btn-admin {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-admin:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-admin-active {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-admin-active:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Enhanced Raid Cards */
.raid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* Last Raids Preview on Home Page */
.last-raids-preview {
    margin-top: 32px;
    padding: 24px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.last-raids-preview h3 {
    color: var(--text-color);
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.raid-list-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.raid-card-compact {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.raid-card-compact:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.raid-compact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.raid-compact-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.raid-compact-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.raid-compact-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}


.raid-card {
    background: linear-gradient(135deg, var(--bg-color), rgba(30, 41, 59, 0.8));
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.raid-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.raid-delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: scale(1.1);
}

.raid-delete-btn svg {
    width: 18px;
    height: 18px;
}

/* Bulk select controls — compact inline in section header */
.bulk-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bulk-inline .bulk-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0 4px;
    white-space: nowrap;
}

.saved-raid-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    z-index: 10;
    accent-color: var(--primary-color);
}

.raid-card.selectable { padding-left: 40px; }
.raid-card.selected {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 8%, var(--card-bg));
}

.raid-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.raid-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
}

.raid-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.raid-card-header h3 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.raid-card-header h3::before {
    content: '🏰';
    font-size: 1.6rem;
}

.raid-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.raid-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.raid-status.completed::before {
    content: '✓ ';
}

.raid-status.in-progress {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    animation: pulse 2s infinite;
}

.raid-status.in-progress::before {
    content: '⏱ ';
}

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

.raid-card-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-row .label::before {
    font-size: 1.1rem;
}

.info-row:nth-child(1) .label::before { content: '📅'; }
.info-row:nth-child(2) .label::before { content: '⏱️'; }
.info-row:nth-child(3) .label::before { content: '👥'; }
.info-row:nth-child(4) .label::before { content: '🧪'; }

.info-row .highlight {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Enhanced Raid Details */
.raid-details-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.raid-info-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.raid-info-stat .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}
.raid-info-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Enhanced Players Section */
.players-section {
    margin-top: 32px;
}

.players-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.players-section h3::before {
    content: '👥';
    font-size: 1.6rem;
}

.player-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── Single-column player list ── */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-row {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.player-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-row:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.player-row:hover::before {
    opacity: 1;
}

.player-row.expanded {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(99, 102, 241, 0.08) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.player-row.expanded::before {
    opacity: 1;
}

/* Collapsed summary bar */
.player-summary {
    display: grid;
    grid-template-columns: 24px minmax(130px, 220px) 110px 1fr auto auto auto auto auto 28px;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    min-height: 42px;
}

.player-summary .expand-indicator {
    color: var(--text-secondary);
    font-size: 0.7rem;
    transition: transform 0.25s ease;
    justify-self: center;
}

.player-row.expanded .expand-indicator {
    transform: rotate(180deg);
}

.player-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Class colors with WoW icons */
.class-warrior { 
    background: linear-gradient(135deg, #c79c6e, #a67c52); 
    color: #000;
    position: relative;
}
.class-warrior::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_warrior.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-paladin { 
    background: linear-gradient(135deg, #f58cba, #e06b9a); 
    color: #000;
}
.class-paladin::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_paladin.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-hunter { 
    background: linear-gradient(135deg, #abd473, #8fb35a); 
    color: #000;
}
.class-hunter::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_hunter.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-rogue { 
    background: linear-gradient(135deg, #fff569, #e6dc50); 
    color: #000;
}
.class-rogue::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_rogue.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-priest { 
    background: linear-gradient(135deg, #ffffff, #e6e6e6); 
    color: #000;
}
.class-priest::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_priest.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-shaman { 
    background: linear-gradient(135deg, #0070de, #005bb5); 
    color: #fff;
}
.class-shaman::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_shaman.jpg');
    background-size: contain;
    vertical-align: middle;
    border-radius: 3px;
}

.class-mage { 
    background: linear-gradient(135deg, #69ccf0, #4db3d6); 
    color: #000;
}
.class-mage::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_mage.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-warlock { 
    background: linear-gradient(135deg, #9482c9, #7a68a8); 
    color: #fff;
}
.class-warlock::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_warlock.jpg');
    background-size: contain;
    vertical-align: middle;
    border-radius: 3px;
}

.class-druid { 
    background: linear-gradient(135deg, #ff7d0a, #e66a00); 
    color: #000;
}
.class-druid::before { 
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_druid.jpg');
    background-size: contain;
    vertical-align: middle;
}

.class-unknown { 
    background: #808080; 
    color: #fff;
}
.class-unknown::before { 
    content: '❓ ';
}

.buff-extra {
    font-size: 0.75rem;
    color: var(--text-secondary);
    align-self: center;
    white-space: nowrap;
}

.summary-time {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Gold cost shown in summary row (only visible when AuxPrices loaded) */
.summary-gold {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    gap: 3px;
    align-items: center;
}
.summary-gold .aux-gold   { color: #f0c040; }
.summary-gold .aux-silver { color: #c0c0c0; }
.summary-gold .aux-copper { color: #c87533; }
.summary-gold--none {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Stat value gold variant used in card view */
.stat-value--gold {
    font-size: 0.78rem;
}
.stat-value--gold .aux-gold   { color: #f0c040; }
.stat-value--gold .aux-silver { color: #c0c0c0; }
.stat-value--gold .aux-copper { color: #c87533; }
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* small inline icon strip shown in summary row */
.buff-icons {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.buff-icon-sm {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    object-fit: cover;
    flex-shrink: 0;
}

/* coverage badge in summary */
.summary-coverage {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Expanded detail panel */
.consumables-list {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 0 14px 10px 14px;
    border-top: 1px solid var(--border-color);
}

.player-row.expanded .consumables-list,
.player-card.expanded .consumables-list {
    display: flex;
}

.consumable-item-row {
    display: grid;
    grid-template-columns: 28px 1fr 70px 80px 90px;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
    font-size: 0.85rem;
}

.consumables-header {
    display: grid;
    grid-template-columns: 28px 1fr 70px 80px 90px;
    gap: 10px;
    padding: 10px 10px 8px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 6px;
}

.consumable-item-row:hover {
    background: rgba(99, 102, 241, 0.08);
}

.consumable-item-row .item-icon {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.1);
}

.consumable-name {
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    font-size: 0.8rem;
}

/* Potions Section */
.potions-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid var(--border-color);
}

.potions-header {
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.potions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.potion-item-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
    font-size: 0.85rem;
}

.potion-item-row:hover {
    background: rgba(139, 92, 246, 0.08);
}

.potion-item-row .item-icon {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.1);
}

.potion-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.8rem;
}

.potion-count {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.85rem;
    min-width: 40px;
    text-align: right;
}

/* Player name with armory links */
.player-name-with-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.armory-links {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.armory-links:hover {
    opacity: 1;
}

.armory-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
    transition: all 0.2s ease;
    text-decoration: none;
}

.armory-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.armory-link.logs-link {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success-color);
}

.armory-link.logs-link:hover {
    background: var(--success-color);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.armory-link svg {
    display: block;
}


.consumable-name a,
.consumable-name span {
    display: inline;
}

.consumable-uses {
    color: var(--success-color);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    font-size: 0.85rem;
}

.consumable-time {
    color: var(--warning-color);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    font-size: 0.8rem;
}

.consumable-coverage {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
}
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: center;
}

.consumable-duration {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: right;
}


.no-consumables {
    color: var(--text-secondary);
    font-style: italic;
    padding: 10px 8px;
    font-size: 0.85rem;
}

/* Enhanced Saved Raids */
.saved-raid-card {
    background: linear-gradient(135deg, var(--bg-color), rgba(30, 41, 59, 0.8));
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid var(--success-color);
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.saved-raid-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.saved-raid-card:hover::before {
    opacity: 1;
}

.saved-raid-card:hover {
    border-left-color: var(--primary-color);
    transform: translateX(6px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.saved-raid-card h4 {
    color: var(--text-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-raid-card h4::before {
    content: '🏰';
    font-size: 1.4rem;
}

.saved-raid-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.saved-raid-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── end player list ── */

/* ── View toggle buttons ── */
.view-toggle-btns {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.view-toggle-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: none;
    transition: background 0.2s, color 0.2s;
}

.view-toggle-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-color);
    transform: none;
    box-shadow: none;
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
}

.view-toggle-btn.active:hover:not(:disabled) {
    background: var(--secondary-color);
}

/* ── Card view grid ── */
.players-list.cards-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 1200px) {
    .players-list.cards-view {
        grid-template-columns: 1fr;
    }
}

.player-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.player-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2),
                0 0 0 1px rgba(99, 102, 241, 0.1);
}

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

.player-card.expanded {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(99, 102, 241, 0.08) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.25);
}

.player-card.expanded::before {
    opacity: 1;
}

/* Compact card header - single line layout when collapsed */
.player-card-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    position: relative;
}

/* Class badge positioned at the start */
.player-card-header .class-badge {
    order: 1;
}

/* Title and name in the middle */
.player-card-title {
    order: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.player-card-title .player-name {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Expand arrow on the right */
.player-card-header .expand-indicator {
    order: 3;
}

/* Stats row - shown below header in compact format */
.player-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    padding: 0 20px 16px 20px;
    font-size: 0.85rem;
}

.player-card-stats > * {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.player-card-stats .stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.player-card-stats .stat-value {
    font-weight: 700;
    color: var(--text-color);
}

/* Coverage colors in stats */
.player-card-stats .stat-value.coverage-excellent {
    color: var(--success-color);
}

.player-card-stats .stat-value.coverage-good {
    color: #22c55e;
}

.player-card-stats .stat-value.coverage-fair {
    color: var(--warning-color);
}

.player-card-stats .stat-value.coverage-poor {
    color: var(--danger-color);
}

.player-card-stats .stat-value.coverage-none {
    color: var(--text-secondary);
}

/* Armory links - positioned in title */
.player-card-title .armory-links {
    margin-left: auto;
    flex-shrink: 0;
}

/* Buff icons strip */
.player-card .buff-icons {
    padding: 0 20px 12px 20px;
}

/* Consumables list for expanded state */
.player-card .consumables-list {
    border-top: 1px solid var(--border-color);
    padding: 14px 20px 18px 20px;
    margin-top: 8px;
}

/* expand arrow rotation via class */
.expand-indicator.rotated {
    transform: rotate(180deg);
}

/* Attendance Section Styles */
.attendance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.saved-raids-list-section {
    margin-top: 32px;
}

.saved-raids-list-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-raids-list-section h3::before {
    content: '📜';
    font-size: 1.6rem;
}

.chart-container {
    background: var(--bg-color);
    padding: 24px;
    border-radius: 12px;
    margin-top: 16px;
    min-height: 300px;
    border: 1px solid var(--border-color);
}

.attendance-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.attendance-table th {
    background: rgba(99, 102, 241, 0.1);
    padding: 14px;
    text-align: left;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--primary-color);
}

.attendance-table td {
    padding: 14px;
    background: rgba(30, 41, 59, 0.5);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.attendance-table tr td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.attendance-table tr td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.attendance-table tr:hover td {
    background: rgba(99, 102, 241, 0.1);
}

.attendance-bar {
    height: 24px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.attendance-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer-bar 2s infinite;
}

@keyframes shimmer-bar {
    to { left: 100%; }
}

.attendance-percentage {
    font-weight: 700;
    color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    header {
        padding: 40px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .raid-list {
        grid-template-columns: 1fr;
    }

    .consumable-item-row {
        grid-template-columns: 22px 1fr auto auto;
        gap: 6px;
        font-size: 0.8rem;
    }
    /* Hide uptime time col on mobile, keep icon/name/uses/coverage */
    .consumable-item-row .consumable-time { display: none; }
    .consumable-item-row.has-prices { grid-template-columns: 22px 1fr auto auto auto; }
    .consumables-header,
    .consumables-header.has-prices { display: none; }

    .player-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-controls,
    .player-controls {
        flex-direction: column;
    }
    .player-controls-extra {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .player-controls-extra .btn-sm {
        flex: 1;
    }

    .upload-controls input[type="file"],
    .upload-controls button,
    .player-controls input,
    .player-controls select {
        width: 100%;
    }
    .aux-upload-controls {
        flex-wrap: wrap;
    }
    .aux-upload-controls input[type="file"] {
        width: 100%;
    }

    .attendance-table {
        font-size: 0.85rem;
    }

    .attendance-table th,
    .attendance-table td {
        padding: 10px 8px;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

/* Item Links and Icons */
.item-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.item-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.item-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

.consumable-name-nolink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Light theme adjustments */
.theme-light {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.theme-light header {
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.3),
                0 0 100px rgba(79, 70, 229, 0.2);
}

.theme-light .player-row {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-light .consumable-item-row {
    background: rgba(79, 70, 229, 0.05);
}

.theme-light .consumable-item-row:hover {
    background: rgba(79, 70, 229, 0.1);
}

/* Theme-specific adjustments */
.theme-candy {
    background: linear-gradient(135deg, #1a0a1f 0%, #0a0514 100%);
}

.theme-candy header {
    background: linear-gradient(135deg, #ec4899, #a855f7, #06b6d4, #10b981);
    background-size: 300% 300%;
    animation: rainbow 8s ease infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Coverage indicators */.coverage-excellent {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.coverage-fair {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

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

/* Attendance table - NEW */
.attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.attendance-table thead {
    background: var(--primary-color);
    color: white;
}

.attendance-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.attendance-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
}

.attendance-table tr {
    transition: background 0.2s ease;
}

.attendance-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}



/* ═══════════════════════════════════════════════════════════════
   NEW FEATURES — added styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Coverage pill (inline badge) ── */
.coverage-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ── Flask pill on raid cards ── */
.flask-pill {
    background: rgba(99,102,241,0.15);
    color: var(--primary-color);
    border: 1px solid rgba(99,102,241,0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Raid Detail Tabs ── */
.raid-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.raid-tabs::-webkit-scrollbar { display: none; }

.raid-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.raid-tab-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.1);
    color: var(--text-color);
    transform: none;
    box-shadow: none;
}

.raid-tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    border-bottom-color: var(--card-bg);
}

.raid-tab-btn.active:hover:not(:disabled) {
    background: var(--card-bg);
    box-shadow: none;
}

.raid-tab-btn.tab-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.raid-tab-btn.tab-disabled:hover {
    background: transparent;
    color: var(--text-secondary);
    transform: none;
    box-shadow: none;
}

.raid-tab-panel { display: none; }
.raid-tab-panel[data-panel="players"] { display: block; }

/* ── Class filter bar ── */
.class-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.class-filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: none;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.class-filter-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.1);
    border-color: var(--primary-color);
    color: var(--text-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

.class-filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

.class-filter-btn.active:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

/* Class-tinted filter buttons - with proper backgrounds */
/* Note: Filter buttons should NOT show the class badge icons */
.class-filter-btn.class-warrior::before,
.class-filter-btn.class-paladin::before,
.class-filter-btn.class-hunter::before,
.class-filter-btn.class-rogue::before,
.class-filter-btn.class-priest::before,
.class-filter-btn.class-shaman::before,
.class-filter-btn.class-mage::before,
.class-filter-btn.class-warlock::before,
.class-filter-btn.class-druid::before {
    display: none !important;
}

.class-filter-btn.class-warrior  { 
    border-color: #c79c6e; 
    color: #c79c6e;
    background: rgba(199, 156, 110, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_warrior.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-warrior.active  { 
    background-color: #c79c6e;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_warrior.jpg'), linear-gradient(135deg, #c79c6e, #a67c52);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #c79c6e; 
    color: #000; 
    font-weight: 800;
}

.class-filter-btn.class-paladin  { 
    border-color: #f58cba; 
    color: #f58cba;
    background: rgba(245, 140, 186, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_paladin.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-paladin.active  { 
    background-color: #f58cba;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_paladin.jpg'), linear-gradient(135deg, #f58cba, #d970a0);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #f58cba; 
    color: #000; 
    font-weight: 800;
}

.class-filter-btn.class-hunter   { 
    border-color: #abd473; 
    color: #abd473;
    background: rgba(171, 212, 115, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_hunter.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-hunter.active   { 
    background-color: #abd473;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_hunter.jpg'), linear-gradient(135deg, #abd473, #8fb35a);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #abd473; 
    color: #000; 
    font-weight: 800;
}

.class-filter-btn.class-rogue    { 
    border-color: #fff569; 
    color: #e6dc50;
    background: rgba(255, 245, 105, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_rogue.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-rogue.active    { 
    background-color: #fff569;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_rogue.jpg'), linear-gradient(135deg, #fff569, #e6dc50);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #fff569; 
    color: #000; 
    font-weight: 800;
}

.class-filter-btn.class-priest   { 
    border-color: #f0ebe0; 
    color: #f0ebe0;
    background: rgba(240, 235, 224, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_priest.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-priest.active   { 
    background-color: #ffffff;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_priest.jpg'), linear-gradient(135deg, #ffffff, #e6e6e6);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #f0ebe0; 
    color: #000; 
    font-weight: 800;
}

.class-filter-btn.class-shaman   { 
    border-color: #2459ff; 
    color: #2459ff;
    background: rgba(36, 89, 255, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_shaman.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-shaman.active   { 
    background-color: #0070de;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_shaman.jpg'), linear-gradient(135deg, #0070de, #005bb5);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #0070de; 
    color: #fff; 
    font-weight: 800;
}

.class-filter-btn.class-mage     { 
    border-color: #69ccf0; 
    color: #69ccf0;
    background: rgba(105, 204, 240, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_mage.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-mage.active     { 
    background-color: #69ccf0;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_mage.jpg'), linear-gradient(135deg, #69ccf0, #4db3d6);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #69ccf0; 
    color: #000; 
    font-weight: 800;
}

.class-filter-btn.class-warlock  { 
    border-color: #9482c9; 
    color: #9482c9;
    background: rgba(148, 130, 201, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_warlock.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-warlock.active  { 
    background-color: #9482c9;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_warlock.jpg'), linear-gradient(135deg, #9482c9, #7a68a8);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #9482c9; 
    color: #fff; 
    font-weight: 800;
}

.class-filter-btn.class-druid    { 
    border-color: #ff7d0a; 
    color: #ff7d0a;
    background: rgba(255, 125, 10, 0.1);
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_druid.jpg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
    padding-left: 36px;
}
.class-filter-btn.class-druid.active    { 
    background-color: #ff7d0a;
    background-image: url('https://wow.zamimg.com/images/wow/icons/small/classicon_druid.jpg'), linear-gradient(135deg, #ff7d0a, #e66a00);
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px, 100% 100%;
    border-color: #ff7d0a; 
    color: #000; 
    font-weight: 800;
}

/* ── Extra controls row ── */
.player-controls-extra {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
}

.btn-sm:hover:not(:disabled) {
    background: rgba(99,102,241,0.1);
    border-color: var(--primary-color);
    color: var(--text-color);
    transform: none;
    box-shadow: none;
}

.btn-danger-sm {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.35);
    color: #ef4444;
}
.btn-danger-sm:hover:not(:disabled) {
    background: rgba(239,68,68,0.22);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-export {
    background: rgba(16,185,129,0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.btn-export:hover:not(:disabled) {
    background: rgba(16,185,129,0.2);
    border-color: var(--success-color);
    color: var(--success-color);
}

/* ── Additional sort options ── */
/* (handled by existing select styles) */

/* ── Sortable table headers ── */
.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-table th.sortable:hover {
    background: rgba(99,102,241,0.15);
}

.sort-icon {
    opacity: 0.4;
    font-size: 0.8rem;
    margin-left: 4px;
}

.sort-icon.active {
    opacity: 1;
    color: var(--primary-color);
}

/* ── Attendance table enhancements ── */
.att-name { font-weight: 600; }

.att-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    max-width: 200px;
}

.att-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.4s ease;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
}

.att-bar-excellent {
    background: linear-gradient(90deg, #10b981, #059669);
}

.att-bar-good {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.att-bar-fair {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.att-bar-poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.att-bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.text-dim {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Potions note */
.potions-note {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ── Heatmap ── */
.heatmap-wrap {
    /* Constrain to panel width so the scroll container has a boundary to scroll within */
    max-width: 100%;
    overflow: hidden;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.hm-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-right: 2px;
}

.hm-excellent { background: rgba(16,185,129,0.55); }
.hm-good      { background: rgba(59,130,246,0.55); }
.hm-fair      { background: rgba(245,158,11,0.55); }
.hm-poor      { background: rgba(239,68,68,0.55); }
.hm-none      { background: rgba(148,163,184,0.1); border: 1px solid var(--border-color); }

.heatmap-scroll {
    overflow-x: auto;
    border-radius: 8px;
    width: 100%;
    cursor: grab;
}
.heatmap-scroll::-webkit-scrollbar        { height: 6px; }
.heatmap-scroll::-webkit-scrollbar-track  { background: transparent; }
.heatmap-scroll::-webkit-scrollbar-thumb  { background: rgba(200,146,42,0.45); border-radius: 3px; }
.heatmap-scroll::-webkit-scrollbar-thumb:hover { background: rgba(200,146,42,0.75); }

.heatmap-table {
    border-collapse: collapse;
    font-size: 0.78rem;
    min-width: 100%;
}

.heatmap-table th, .heatmap-table td {
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    text-align: center;
    white-space: nowrap;
}

.heatmap-table thead th {
    background: var(--card-bg);
    color: var(--primary-color);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
/* Corner cell: sticky both top and left */
.heatmap-table thead th.hm-player-col {
    z-index: 4;
}

.hm-player-col, .hm-class-col {
    text-align: left;
    min-width: 100px;
}

.hm-player-col {
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 3;
    box-shadow: 2px 0 6px rgba(0,0,0,0.25);
}

.hm-player-name {
    font-weight: 600;
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 1;
}

.hm-cons-col { min-width: 42px; }

.hm-icon {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    display: block;
    margin: 0 auto;
}

.hm-cell {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 0;
}

.hm-cell.hm-excellent { background: rgba(16,185,129,0.25); color: #10b981; }
.hm-cell.hm-good      { background: rgba(59,130,246,0.25); color: #3b82f6; }
.hm-cell.hm-fair      { background: rgba(245,158,11,0.25); color: #f59e0b; }
.hm-cell.hm-poor      { background: rgba(239,68,68,0.25); color: #ef4444; }
.hm-cell.hm-none      { color: var(--text-secondary); opacity: 0.4; }

.heatmap-table tbody tr:hover td { filter: brightness(1.2); }

/* ── Potions table ── */
.potions-wrap { overflow-x: auto; }

.potions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.potions-table th {
    background: rgba(99,102,241,0.1);
    color: var(--primary-color);
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
}

.potions-table td {
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}

.potions-table tbody tr:hover td { background: rgba(99,102,241,0.05); }

.pt-name { font-weight: 600; }

.pt-val { color: var(--text-secondary); text-align: center; }
.pt-val-pos { color: var(--success-color); font-weight: 700; text-align: center; }
.pt-total { font-weight: 700; color: var(--primary-color); text-align: center; }

.pt-footer td { background: rgba(99,102,241,0.08); border-top: 2px solid var(--primary-color); }

.no-data-msg {
    color: var(--text-secondary);
    font-style: italic;
    padding: 24px;
    text-align: center;
}

/* ── Summary tab ── */
.summary-wrap { display: flex; flex-direction: column; gap: 32px; }

.summary-section-title {
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.tier-bars { display: flex; flex-direction: column; gap: 10px; max-width: 600px; }

.tier-bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 140px;
    align-items: center;
    gap: 12px;
}

.tier-label { text-align: center; min-width: 80px; }

.tier-bar-track {
    height: 20px;
    background: rgba(148,163,184,0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.tier-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.tier-fill-excellent { background: linear-gradient(90deg, #10b981, #059669); }
.tier-fill-good      { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.tier-fill-fair      { background: linear-gradient(90deg, #f59e0b, #d97706); }
.tier-fill-poor      { background: linear-gradient(90deg, #ef4444, #dc2626); }

.tier-count { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }

/* ── Consumable adoption table ── */
.cons-adoption-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.cons-adoption-table th {
    background: rgba(99,102,241,0.1);
    color: var(--primary-color);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
}

.cons-adoption-table td {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
}

.cons-adoption-table tbody tr:hover td { background: rgba(99,102,241,0.05); }

.cons-category {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-style: italic;
}

.adoption-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.adoption-bar {
    height: 10px;
    border-radius: 5px;
    transition: width 0.4s ease;
    flex-shrink: 0;
}

.adoption-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.adoption-excellent { background: linear-gradient(90deg, #10b981, #059669); }
.adoption-good      { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.adoption-fair      { background: linear-gradient(90deg, #f59e0b, #d97706); }
.adoption-poor      { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ── Attendance extra column ── */
.attendance-table { font-size: 0.85rem; }
.attendance-table th { font-size: 0.78rem; }

/* ── Attendance Controls ── */
.attendance-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.attendance-controls input[type="text"] {
    flex: 1;
    min-width: 250px;
}

/* ── Charts Grid ── */
.charts-grid-full {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card-wide {
    grid-column: span 1;
}

@media (max-width: 900px) {
    .charts-grid-full {
        grid-template-columns: 1fr;
    }
}

/* Keep old .charts-grid for compatibility */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px 28px;
    transition: box-shadow 0.2s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.chart-card h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.chart-viz {
    min-height: 380px;
    position: relative;
    display: flex;
    align-items: flex-start;
}

.chart-viz svg {
    width: 100%;
    height: auto;
}

/* ── Simple Bar Charts ── */
.simple-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-label {
    min-width: 120px;
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 30px;
    transition: width 0.4s ease;
}

.chart-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
}

.class-chart-bar {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.6), rgba(139, 92, 246, 0.6));
}


/* ================================================
   ENHANCED ANIMATIONS & EFFECTS
   ================================================ */

/* Smooth fade-in for content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-row, .player-card, .raid-card {
    animation: fadeIn 0.3s ease-out;
}

/* Pulse animation for coverage badges */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.coverage-excellent {
    animation: pulse 2s infinite;
}

/* Shimmer effect for consumable items on hover */
.consumable-item-row::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.consumable-item-row {
    position: relative;
    overflow: hidden;
}

.consumable-item-row:hover::after {
    left: 100%;
}

/* Enhanced icon glow effect */
.item-icon, .buff-icon-sm {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
    transition: all 0.2s ease;
}

.consumable-item-row:hover .item-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

/* Tooltip enhancement */
[title]:hover {
    position: relative;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

/* Improved gradient backgrounds */
.section {
    background: linear-gradient(
        135deg,
        var(--card-bg) 0%,
        rgba(99, 102, 241, 0.02) 50%,
        var(--card-bg) 100%
    );
}

/* Enhanced raid cards with sparkle effect */
.raid-card {
    position: relative;
    overflow: hidden;
}

.raid-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: sparkle 3s linear infinite;
}

@keyframes sparkle {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.raid-card:hover::after {
    animation-duration: 1.5s;
}

/* Better focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Microinteractions for buttons */
.btn-primary, .btn-secondary, .btn-sm {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before,
.btn-sm::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before,
.btn-secondary:active::before,
.btn-sm:active::before {
    width: 300px;
    height: 300px;
}

/* Glass morphism effect for cards */
.theme-candy .player-card,
.theme-candy .raid-card {
    backdrop-filter: blur(10px);
    background: rgba(45, 27, 61, 0.8);
}

/* Enhanced consumable icons with subtle bounce */
.buff-icon-sm {
    transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.player-row:hover .buff-icon-sm {
    transform: scale(1.1) rotate(5deg);
}

.player-row:hover .buff-icon-sm:nth-child(2n) {
    transform: scale(1.1) rotate(-5deg);
}

/* Stagger animation for list items */
.player-row:nth-child(1) { animation-delay: 0ms; }
.player-row:nth-child(2) { animation-delay: 50ms; }
.player-row:nth-child(3) { animation-delay: 100ms; }
.player-row:nth-child(4) { animation-delay: 150ms; }
.player-row:nth-child(5) { animation-delay: 200ms; }

/* Beautiful gradient text for headers */
.section h2 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* (status-message styles defined at top of file) */

/* Improved responsive behavior */
@media (max-width: 768px) {
    .armory-links {
        flex-direction: column;
        gap: 4px;
    }
    
    .player-summary {
        /* icon | name+class | coverage | arrow */
        grid-template-columns: 20px 1fr auto auto 24px;
        gap: 6px;
        padding: 8px 10px;
    }
    /* Hide buff icons strip, buff count, time, gold — keep name, class, coverage */
    .player-summary .buff-icons,
    .player-summary .consumable-count,
    .player-summary .summary-time,
    .player-summary .summary-gold {
        display: none;
    }
}

/* Dark mode enhancements */
.theme-dark .player-row:hover,
.theme-dark .player-card:hover {
    box-shadow: 
        0 8px 24px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Light mode refinements */
.theme-light .player-row,
.theme-light .player-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-light .player-row:hover,
.theme-light .player-card:hover {
    box-shadow: 
        0 8px 24px rgba(79, 70, 229, 0.2),
        0 4px 12px rgba(79, 70, 229, 0.1);
}

/* Candy theme special effects */
.theme-candy {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #1a0a1f 0%, #020617 100%);
}

.theme-candy .player-row:hover::before,
.theme-candy .player-card:hover::before {
    background: linear-gradient(180deg, #ec4899, #a855f7, #f59e0b);
}

/* ──────────────────────────────────────────────────────────────────────────
   LOADED RAIDS PREVIEW WITH CHECKBOXES
   ────────────────────────────────────────────────────────────────────────── */

.loaded-raids-preview {
    padding: 24px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loaded-raids-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.loaded-raid-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.loaded-raid-item:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.raid-checkbox {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.loaded-raid-content {
    flex: 1;
    min-width: 0;
}

.loaded-raid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.loaded-raid-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.loaded-raid-file {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 4px 10px;
    border-radius: 6px;
}

.loaded-raid-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.loaded-raid-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Selected state */
.loaded-raid-item:has(.raid-checkbox:checked) {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Disabled button state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Theme-specific checkbox styles */
.theme-dark .raid-checkbox {
    filter: brightness(1.2);
}

.theme-light .raid-checkbox {
    filter: brightness(0.95);
}

.theme-candy .raid-checkbox {
    accent-color: #ec4899;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loaded-raid-item {
        padding: 12px;
        gap: 12px;
    }
    
    .loaded-raid-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .loaded-raid-meta {
        gap: 12px;
        font-size: 0.85rem;
    }
    
    .raid-checkbox {
        width: 18px;
        height: 18px;
    }
    /* Gold badge in player list: smaller on mobile */
    .summary-gold {
        font-size: 0.7rem;
    }
    /* Raid info stat cards: compact on mobile */
    .raid-info-stat .stat-value {
        font-size: 1rem;
    }
    /* Loot table: horizontal scroll */
    .loot-table-wrap,
    .loot-items-list {
        overflow-x: auto;
    }
    /* Heatmap: ensure full width scroll */
    .heatmap-wrap {
        margin: 0 -12px;
        padding: 0 12px;
    }
}

/* Scrollbar styling for loaded raids list */
.loaded-raids-list::-webkit-scrollbar {
    width: 8px;
}

.loaded-raids-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.loaded-raids-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.loaded-raids-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Button group alignment */
.loaded-raids-preview button {
    min-width: 120px;
}


/* ═══════════════════════════════════════════════════════════════
   DEATHS TAB
   ═══════════════════════════════════════════════════════════════ */

.deaths-panel {
    padding: 20px 0;
}

.deaths-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.deaths-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.death-leaderboard-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.death-leaderboard-row:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.death-rank {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 40px;
}

.death-player-name-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.death-player-name {
    font-weight: 600;
    font-size: 1.05em;
}

.death-count {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--accent-color);
    margin-left: auto;
}

.deaths-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.death-timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.death-time {
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    min-width: 90px;
    font-size: 0.9em;
}

/* ═══════════════════════════════════════════════════════════════
   SUNDERS TAB
   ═══════════════════════════════════════════════════════════════ */

.sunders-panel {
    padding: 20px 0;
}

.sunders-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sunders-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sunder-leaderboard-row {
    display: grid;
    grid-template-columns: 50px 1fr auto 300px;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.sunder-leaderboard-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.sunder-rank {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
}

.sunder-player-name-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sunder-player-name {
    font-weight: 600;
    font-size: 1.05em;
}

.sunder-count {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--primary-color);
    min-width: 60px;
    text-align: right;
}

.sunder-bar-container {
    position: relative;
    height: 32px;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.sunder-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
    border-radius: 8px;
}

.sunder-percentage {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-color);
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════════════════════
   LOOT TAB
   ═══════════════════════════════════════════════════════════════ */

.loot-panel {
    padding: 20px 0;
}

.loot-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Loot Tab - Collapsible Rows */
.loot-player-row {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.loot-player-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.loot-player-row .player-summary {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    min-height: 42px;
}

.loot-player-row .player-name-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loot-player-row .loot-count {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

.loot-player-row .consumables-list {
    display: none;
    padding: 0 16px 16px 16px;
}

.loot-player-row.expanded .consumables-list {
    display: block;
}

.loot-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loot-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.loot-item-row:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
}

.loot-item-link {
    flex: 1;
}

.item-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.item-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.item-quantity {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--card-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.item-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.item-quantity {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-left: 4px;
}

/* ── Loot quality filter bar ─────────────────────────────────────────────── */
.quality-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 4px;
}

.quality-filter-label {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
}

.quality-filter-btn {
    padding: 3px 12px;
    border-radius: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    opacity: 0.38;
    transition: opacity 0.15s, border-color 0.15s;
    background: transparent;
    color: inherit;
}
.quality-filter-btn.active {
    opacity: 1;
    border-color: currentColor;
}
.quality-filter-btn:hover { opacity: 0.8; }

/* All / None utility buttons */
.quality-filter-all,
.quality-filter-none {
    background: var(--card-bg);
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary);
    opacity: 0.75;
    margin-left: 6px;
}
.quality-filter-all:hover,
.quality-filter-none:hover { opacity: 1; }

/* Per-quality colours (match in-game palette) */
.q-poor      { color: #9d9d9d; }
.q-common    { color: #e8e8e8; }
.q-uncommon  { color: #1eff00; }
.q-rare      { color: #0070dd; }
.q-epic      { color: #a335ee; }
.q-legendary { color: #ff8000; }

/* Item link colours by quality */
.item-link.q-poor      { color: #9d9d9d; }
.item-link.q-common    { color: var(--text-color); }
.item-link.q-uncommon  { color: #1eff00; }
.item-link.q-rare      { color: #4db8ff; }
.item-link.q-epic      { color: #c27cf9; }
.item-link.q-legendary { color: #ff9a33; }
.item-link.q-poor:hover      { color: #bdbdbd; }
.item-link.q-uncommon:hover  { color: #6fff4a; }
.item-link.q-rare:hover      { color: #80ccff; }
.item-link.q-epic:hover      { color: #d49dff; }
.item-link.q-legendary:hover { color: #ffbb66; }

/* Small note showing filtered count */
.loot-filter-note {
    color: var(--text-muted);
    font-size: 0.8em;
    font-weight: 400;
    margin-left: 8px;
}

/* ── Zone filter bar ─────────────────────────────────────────────────────── */
/* Reuses .quality-filter-bar layout — just needs the button variant */
.zone-filter-bar {
    margin-top: 6px;
}

.zone-filter-btn {
    padding: 3px 11px;
    border-radius: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    background: var(--card-bg);
    color: var(--text-secondary);
    opacity: 0.45;
    transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}
.zone-filter-btn.active {
    opacity: 1;
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.zone-filter-btn:hover { opacity: 0.85; }

.zone-filter-all,
.zone-filter-none {
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary);
    opacity: 0.75;
    margin-left: 6px;
}
.zone-filter-all:hover,
.zone-filter-none:hover { opacity: 1; }

/* Space between the two filter bars when both are visible */
#lootHistoryQualityBar + #lootHistoryZoneBar .quality-filter-bar {
    margin-top: 6px;
}

.money-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.money-timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 3px solid #fbbf24;
}

.money-time {
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    min-width: 90px;
    font-size: 0.9em;
}

.money-player {
    flex: 1;
    font-weight: 500;
}

.money-amount {
    font-weight: 600;
    color: #fbbf24;
    font-family: 'Courier New', monospace;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.2em;
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .deaths-summary,
    .sunders-summary,
    .loot-summary {
        grid-template-columns: 1fr;
    }
    
    .death-timeline-item,
    .money-timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .death-time,
    .money-time {
        min-width: auto;
    }
    
    .death-leaderboard-row {
        flex-wrap: wrap;
    }
    
    .death-rank {
        min-width: 30px;
    }
    
    .sunder-leaderboard-row {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }
    
    .sunder-count {
        grid-column: 1;
        grid-row: 2;
        font-size: 1em;
        text-align: left;
        min-width: auto;
    }
    
    .sunder-bar-container {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
    }
}
/* ============================================
   VISUAL POLISH ENHANCEMENTS v1.4.0
   Add this to the end of style.css
   ============================================ */

/* ── GLASSMORPHISM EFFECTS ── */

.section {
    background: rgba(30, 41, 59, 0.6) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 20px 60px rgba(99, 102, 241, 0.15);
}

.theme-light .section {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.player-card,
.raid-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-light .player-card,
.theme-light .raid-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ── SMOOTH ANIMATIONS & MICRO-INTERACTIONS ── */

/* Card hover effects */
.player-card:hover,
.raid-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.3),
        0 0 30px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

/* Button press effect */
button,
.btn,
.btn-primary,
.btn-secondary {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active,
.btn:active,
.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.96);
}

/* Smooth fade in for elements */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-card,
.raid-card {
    animation: fadeIn 0.3s ease-out;
}

/* Ripple effect on clicks */
.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary:active::after,
.btn-secondary:active::after {
    width: 300px;
    height: 300px;
}

/* ── LOADING SKELETONS ── */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.theme-light .skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.04) 25%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.04) 75%
    );
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    padding: 20px;
    margin: 12px 0;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-line {
    height: 16px;
    margin: 10px 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ── TOOLTIPS ── */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Multiline tooltips */
[data-tooltip-multiline]::before {
    white-space: pre-wrap;
    max-width: 250px;
    text-align: left;
}

/* ── PROGRESS BARS ── */

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 14px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 15px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Animated shimmer on progress bar */
.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Color-coded progress bars */
.progress-excellent { background: linear-gradient(90deg, #10b981, #059669); }
.progress-good { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.progress-average { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-poor { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ── PERFORMANCE COLOR CODING ── */

.coverage-excellent { 
    color: #10b981 !important;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.coverage-good { 
    color: #3b82f6 !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.coverage-average { 
    color: #f59e0b !important;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.coverage-poor { 
    color: #ef4444 !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Badge indicators */
.performance-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.badge-excellent {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.3));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.badge-good {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.3));
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.badge-average {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.3));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.badge-poor {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.3));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* ── CLASS COLORS (WoW Authentic) ── */

.class-warrior { 
    border-left: 4px solid #C79C6E;
    box-shadow: -2px 0 10px rgba(199, 156, 110, 0.3);
}
.class-mage { 
    border-left: 4px solid #69CCF0;
    box-shadow: -2px 0 10px rgba(105, 204, 240, 0.3);
}
.class-priest { 
    border-left: 4px solid #FFFFFF;
    box-shadow: -2px 0 10px rgba(255, 255, 255, 0.3);
}
.class-rogue { 
    border-left: 4px solid #FFF569;
    box-shadow: -2px 0 10px rgba(255, 245, 105, 0.3);
}
.class-warlock { 
    border-left: 4px solid #9482C9;
    box-shadow: -2px 0 10px rgba(148, 130, 201, 0.3);
}
.class-hunter { 
    border-left: 4px solid #ABD473;
    box-shadow: -2px 0 10px rgba(171, 212, 115, 0.3);
}
.class-druid { 
    border-left: 4px solid #FF7D0A;
    box-shadow: -2px 0 10px rgba(255, 125, 10, 0.3);
}
.class-shaman { 
    border-left: 4px solid #0070DE;
    box-shadow: -2px 0 10px rgba(0, 112, 222, 0.3);
}
.class-paladin { 
    border-left: 4px solid #F58CBA;
    box-shadow: -2px 0 10px rgba(245, 140, 186, 0.3);
}

/* ── ENHANCED SHADOWS & DEPTH ── */

.section {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 100px rgba(99, 102, 241, 0.1);
}

.player-card,
.raid-card {
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 1px rgba(255, 255, 255, 0.1) inset;
}

button:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
    box-shadow: 
        0 8px 24px rgba(99, 102, 241, 0.4),
        0 0 20px rgba(99, 102, 241, 0.2);
}

/* ── ENHANCED MOBILE RESPONSIVENESS ── */

@media (max-width: 768px) {
    /* Bigger touch targets — exclude tab buttons and small buttons */
    button:not(.raid-tab-btn):not(.btn-sm):not(.class-filter-btn):not(.hm-sort-btn):not(.zone-filter-btn),
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    .raid-tab-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        min-height: unset;
    }
    
    /* Better spacing for fingers */
    .player-controls,
    .section-header {
        gap: 16px !important;
    }
    
    /* Simplify glassmorphism on mobile for performance */
    .section,
    .player-card,
    .raid-card {
        backdrop-filter: blur(10px);
    }
    
    /* Section header: wrap buttons but don't stretch full width */
    .section-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    .section-header h2 {
        width: 100%;
        margin-bottom: 4px;
    }
    .section-header button,
    .section-header .btn {
        width: auto;
        flex: 1 1 auto;
        min-width: 80px;
    }
}

/* ── TOAST NOTIFICATIONS ── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(99, 102, 241, 0.3);
    z-index: 10000;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
}

.toast.toast-success {
    border-left: 4px solid #10b981;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(16, 185, 129, 0.4);
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(239, 68, 68, 0.4);
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(245, 158, 11, 0.4);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-hiding {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ── ICON ENHANCEMENTS ── */

.icon-large {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.icon-glow {
    filter: drop-shadow(0 0 8px currentColor);
}

/* ── EMPTY STATES ── */

.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
    filter: grayscale(0.5);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

/* ── IMPROVED FOCUS STATES ── */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ── PULSING INDICATORS ── */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── GLOW EFFECTS FOR IMPORTANT ITEMS ── */

.glow-success {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    animation: glow-pulse 2s ease-in-out infinite;
}

.glow-warning {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    animation: glow-pulse 2s ease-in-out infinite;
}

.glow-danger {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px currentColor;
    }
    50% {
        box-shadow: 0 0 40px currentColor;
    }
}

/* ── SMOOTH SCROLLING ── */

html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
    background-clip: padding-box;
}

/* ── ACCESSIBILITY IMPROVEMENTS ── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   END OF VISUAL POLISH ENHANCEMENTS
   ============================================ */
/* ═══════════════════════════════════════════════════════════════════════════
   WOW-THEMED COLOR SCHEMES - Add to your existing style.css
   ═══════════════════════════════════════════════════════════════════════════ */

/* HORDE RED THEME */
.theme-horde {
    --primary-color: #8c1616;
    --secondary-color: #b91c1c;
    --success-color: #15803d;
    --warning-color: #ca8a04;
    --danger-color: #7f1d1d;
    --bg-color: #1a0505;
    --card-bg: #2d0a0a;
    --text-color: #fecaca;
    --text-secondary: #dc2626;
    --border-color: #7f1d1d;
    --hover-color: #991b1b;
    --accent-glow: rgba(185, 28, 28, 0.4);
}

.theme-horde body {
    background: linear-gradient(135deg, #1a0505 0%, #0a0000 100%);
}

/* ALLIANCE BLUE THEME */
.theme-alliance {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #0d9488;
    --warning-color: #eab308;
    --danger-color: #dc2626;
    --bg-color: #020617;
    --card-bg: #0f172a;
    --text-color: #dbeafe;
    --text-secondary: #60a5fa;
    --border-color: #1e3a8a;
    --hover-color: #1e40af;
    --accent-glow: rgba(59, 130, 246, 0.4);
}

.theme-alliance body {
    background: linear-gradient(135deg, #020617 0%, #000814 100%);
}

/* CLASSIC WOW (Vanilla/Beige) THEME */
.theme-classic {
    --primary-color: #92400e;
    --secondary-color: #b45309;
    --success-color: #65a30d;
    --warning-color: #ca8a04;
    --danger-color: #991b1b;
    --bg-color: #1c1917;
    --card-bg: #292524;
    --text-color: #fef3c7;
    --text-secondary: #d97706;
    --border-color: #78716c;
    --hover-color: #57534e;
    --accent-glow: rgba(180, 83, 9, 0.3);
}

.theme-classic body {
    background: linear-gradient(135deg, #1c1917 0%, #0c0a09 100%);
}

/* Theme selector dropdown styling */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-selector {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 110px;
}

.theme-selector:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.theme-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.theme-selector option {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 6px;
}

/* Player Profile Page Styles */
.player-profile-section {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 4px solid var(--border-color);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}

.profile-class {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.profile-stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.profile-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-raids-list {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.profile-raids-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-raid-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.profile-raid-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(4px);
}

.profile-raid-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-raid-zone {
    font-weight: bold;
    color: var(--text-color);
}

.profile-raid-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.profile-raid-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.profile-raid-stat {
    text-align: center;
}

.profile-raid-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.profile-raid-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Share Modal Styles */
.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.share-modal-content {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.share-modal-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-url-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.share-url-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.9rem;
}

.share-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.share-copy-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.share-modal-close {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.share-modal-close:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Action buttons at bottom of raid details */
.raid-action-buttons {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 2px solid var(--border-color);
    padding: 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.raid-action-btn {
    padding: 6px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.raid-action-btn:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.raid-action-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.raid-action-btn.primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Discord Webhook Settings */
.webhook-settings {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.webhook-settings h3 {
    color: var(--text-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.webhook-input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.webhook-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.webhook-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.webhook-toggle label {
    color: var(--text-color);
    cursor: pointer;
}

.webhook-test-btn {
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.webhook-test-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════
   NEW FEATURES — v1.6.0
   1. Smooth section transitions
   2. Heatmap sort improvements
   3. Saved raids search toolbar
   4. Player profile slide-in panel
   5. Mobile bottom nav bar
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. SECTION TRANSITIONS ─────────────────────────────────────── */
.section {
    opacity: 1;
    transform: translateY(0);
}

.section-enter {
    animation: sectionReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sectionReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── 2. HEATMAP IMPROVEMENTS ────────────────────────────────────── */
.heatmap-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hm-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hm-sort-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.hm-sort-btn {
    padding: 5px 12px !important;
    font-size: 0.8rem !important;
    min-height: unset !important;
    background: var(--border-color) !important;
    box-shadow: none !important;
}

.hm-sort-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
}

.hm-sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    white-space: nowrap;
}

.hm-sortable:hover {
    background: rgba(99, 102, 241, 0.15);
}

.hm-col-active {
    background: rgba(99, 102, 241, 0.2) !important;
}

.hm-col-arrow {
    font-size: 0.75rem;
    margin-left: 3px;
    color: var(--primary-color);
}

.hm-avg-col {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 52px;
    text-align: center;
}

.hm-avg-cell {
    text-align: center;
    font-size: 0.85rem;
}

.hm-player-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.hm-row {
    cursor: pointer;
    transition: background 0.15s;
}

.hm-row:hover td {
    background: rgba(99, 102, 241, 0.08);
}

.hm-cross {
    color: var(--border-color);
    font-size: 1rem;
    font-weight: 700;
}

/* ── 3. SAVED RAIDS TOOLBAR ─────────────────────────────────────── */
.saved-raids-toolbar {
    margin-bottom: 20px;
}

.saved-raids-search-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.saved-raids-search-wrap input[type="text"] {
    flex: 2;
    min-width: 180px;
}

.saved-raids-search-wrap select {
    flex: 1;
    min-width: 130px;
}

.saved-raids-count {
    font-size: 0.83rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 2px 0 8px 2px;
}

/* ── 4. PLAYER PROFILE PANEL ────────────────────────────────────── */
.pp-trigger {
    cursor: pointer;
    border-bottom: 1px dashed var(--primary-color);
    transition: color 0.15s, border-color 0.15s;
}

.pp-trigger:hover {
    color: var(--primary-color);
    border-color: transparent;
}

.pp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.pp-panel {
    width: min(440px, 100vw);
    height: 100%;
    background: var(--card-bg);
    border-left: 2px solid var(--border-color);
    overflow-y: auto;
    padding: 28px 24px 100px;
    position: relative;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
}

.pp-panel-enter {
    transform: translateX(0) !important;
}

.pp-panel-exit {
    transform: translateX(100%) !important;
    transition: transform 0.25s ease-in !important;
}

.pp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    box-shadow: none;
    min-height: unset;
}

.pp-close:hover {
    background: var(--danger-color);
    transform: scale(1.1);
    box-shadow: none;
}

.pp-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-top: 4px;
}

.pp-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid var(--border-color);
    box-shadow: 0 4px 12px var(--accent-glow);
    flex-shrink: 0;
    padding: 0;
}

.pp-title-block {
    flex: 1;
    padding-top: 4px;
}

.pp-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
    margin-bottom: 4px;
}

.pp-class-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.pp-armory-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pp-armory-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
}

.pp-armory-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.pp-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.pp-stat {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.pp-stat-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 3px;
}

.pp-stat-lbl {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.pp-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    margin-top: 20px;
}

.pp-trend {
    margin-bottom: 4px;
}

.pp-sparkline-wrap {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px 8px;
    overflow: hidden;
}

.pp-spark-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 0 4px;
}

.pp-raids-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pp-raid-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.pp-raid-row:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.pp-raid-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pp-raid-zone {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
}

.pp-raid-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.pp-raid-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pp-raid-pill {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

.pp-flask-badge {
    font-size: 0.95rem;
    title: "Flasked";
}

.low-assist-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: rgba(220, 60, 60, 0.18);
    color: #e05555;
    border: 1px solid rgba(220, 60, 60, 0.40);
    white-space: nowrap;
    vertical-align: middle;
    cursor: default;
    user-select: none;
}

.pp-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 24px;
    font-style: italic;
}

/* ── 5. MOBILE BOTTOM NAV ───────────────────────────────────────── */
.mob-nav {
    display: none; /* hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 8000;
    background: var(--card-bg);
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    /* Safe area for iPhone notch */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mob-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}

.mob-nav {
    display: none;
    justify-content: space-around;
    align-items: stretch;
}

.mob-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 10px 4px 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    box-shadow: none;
    min-height: unset;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: relative;
}

.mob-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    transform: none;
    box-shadow: none;
}

.mob-nav-btn::before {
    display: none; /* kill the ripple pseudo-element */
}

.mob-nav-btn svg {
    transition: stroke 0.2s;
    flex-shrink: 0;
}

.mob-nav-btn.active {
    color: var(--primary-color);
}

.mob-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

.mob-nav-btn.active svg {
    stroke: var(--primary-color);
}

/* ── Show nav + add body padding on mobile ── */
@media (max-width: 768px) {
    .mob-nav {
        display: flex;
    }

    /* Push content above the nav bar */
    .container {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    /* Hide the fixed theme selector on very small screens to save space */
    .theme-toggle {
        top: 10px;
        right: 10px;
    }

    .theme-selector {
        font-size: 11px;
        padding: 4px 8px;
        min-width: 90px;
    }

    /* Section header buttons shouldn't stretch on mobile when nav is present */
    .section-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .section-header button {
        width: auto;
    }

    /* Profile panel full-width on mobile */
    .pp-panel {
        width: 100vw;
        border-left: none;
        border-top: 2px solid var(--border-color);
    }

    .pp-overlay {
        align-items: flex-end;
    }

    .pp-panel {
        height: 90vh;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
    }

    .pp-panel-enter {
        transform: translateY(0) !important;
    }

    .pp-panel-exit {
        transform: translateY(100%) !important;
    }

    /* Heatmap sort bar stacks nicely */
    .heatmap-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ── Aux Price Column ──────────────────────────────────────────────────── */
.consumable-item-row.has-prices,
.consumables-header.has-prices {
    grid-template-columns: 28px 1fr 70px 80px 90px 90px;
}

.consumable-cost {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.consumable-cost-unknown {
    color: var(--text-secondary);
    font-weight: 400;
}

.price-gold   { color: #f4b942; display: inline; }
.price-silver { color: #c0c0c0; display: inline; }
.price-copper { color: #b87333; display: inline; }

.summary-gold { font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.summary-gold-unknown { color: var(--text-secondary); font-weight: 400; font-size: 0.75rem; }
.stat-gold { font-size: 0.82rem; font-weight: 700; white-space: nowrap; }

.player-total-cost {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(244, 185, 66, 0.08);
    border: 1px solid rgba(244, 185, 66, 0.2);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ── Aux Price Badge (public) ──────────────────────────────────────────── */
.aux-price-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 5px 10px;
    background: rgba(244, 185, 66, 0.06);
    border: 1px solid rgba(244, 185, 66, 0.15);
    border-radius: 6px;
}
.aux-price-badge strong {
    color: var(--text-color);
}
.aux-badge-ago {
    opacity: 0.6;
    font-size: 0.75rem;
}

/* ── Aux Upload UI ─────────────────────────────────────────────────────── */
.aux-upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.aux-upload-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.aux-optional {
    font-size: 0.75rem;
    opacity: 0.6;
}
.aux-price-status {
    font-size: 0.8rem;
    color: var(--success-color, #10b981);
}
/* ── Gold cost columns ───────────────────────────────────────────────────── */
.consumable-gold {
    text-align: right;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* When prices are loaded, expand grid to 6 columns */
.consumable-item-row.has-prices {
    grid-template-columns: 28px 1fr 70px 80px 90px 90px;
}
.consumables-header.has-prices {
    grid-template-columns: 28px 1fr 70px 80px 90px 90px;
}

/* Player total gold row at bottom of consumables list */
.player-gold-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 7px 10px 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}
.player-gold-total-row .aux-price { font-size: 0.82rem; }

/* Raid-level gold summary strip */
.raid-gold-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(240, 192, 64, 0.07);
    border: 1px solid rgba(240, 192, 64, 0.22);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.raid-gold-summary .rgs-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.raid-gold-summary .rgs-value {
    font-weight: 700;
}
.raid-gold-summary .rgs-sep {
    width: 1px;
    height: 18px;
    background: rgba(240, 192, 64, 0.25);
    flex-shrink: 0;
}
.raid-gold-summary .rgs-ts {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Aux gold colour classes (also defined in aux-prices.js for admin) */
.aux-price         { font-size: 0.78rem; white-space: nowrap; }
.aux-gold          { color: #f0c040; font-weight: 700; }
.aux-silver        { color: #c0c0c0; font-weight: 600; }
.aux-copper        { color: #c87533; }
.aux-no-price      { color: var(--text-secondary); }

@media (max-width: 600px) {
    .consumable-item-row.has-prices {
        grid-template-columns: 22px 1fr auto auto auto;
    }
    .consumable-item-row.has-prices .consumable-gold { display: none; }
    .raid-gold-summary { gap: 8px; padding: 8px 12px; font-size: 0.75rem; }
}

/* ── Class Buffs Tab ──────────────────────────────────────────────────────── */
.cb-panel {
    padding: 20px 0;
}

/* Section (one per class) */
.cb-section {
    margin-bottom: 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.cb-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.03);
    border-bottom: 2px solid;
    flex-wrap: wrap;
}

.cb-class-icon {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    flex-shrink: 0;
}

.cb-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cb-section-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Two-column layout inside each section */
.cb-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.cb-col {
    padding: 18px 20px;
}

.cb-col + .cb-col {
    border-left: 1px solid var(--border-color);
}

.cb-col-heading {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Overall leaderboard (left col) */
.cb-leader-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cb-leader-row {
    display: grid;
    grid-template-columns: 36px 1fr 48px 160px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.18s;
}

.cb-leader-row:hover { border-color: var(--border-color); }

.cb-leader-rank {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
}

.cb-leader-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-leader-count {
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
}

/* Per-spell breakdown (right col) */
.cb-spell-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cb-spell-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.cb-spell-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.025);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.cb-spell-card-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.cb-spell-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.cb-badge-group  { background: rgba(99,102,241,0.2);  color: #818cf8; }
.cb-badge-single { background: rgba(16,185,129,0.15); color: #34d399; }

.cb-spell-card-total {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.cb-spell-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cb-spell-row {
    display: grid;
    grid-template-columns: 30px 1fr 44px 120px;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}

.cb-spell-row:last-child { border-bottom: none; }
.cb-spell-row:hover { background: rgba(255,255,255,0.03); }

.cb-spell-rank {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}

.cb-spell-player {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
}

.cb-spell-pname {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-spell-count {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
}

/* Shared bar */
.cb-bar-container {
    position: relative;
    height: 22px;
    background: var(--card-bg);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.cb-bar {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    border-radius: 5px;
    transition: width 0.45s ease;
}

.cb-bar-pct {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-color);
    z-index: 1;
}

/* Responsive */
@media (max-width: 860px) {
    .cb-two-col {
        grid-template-columns: 1fr;
    }
    .cb-col + .cb-col {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    .cb-leader-row {
        grid-template-columns: 30px 1fr 44px 100px;
    }
    .cb-spell-row {
        grid-template-columns: 26px 1fr 38px 90px;
    }
}

@media (max-width: 560px) {
    .cb-leader-row {
        grid-template-columns: 28px 1fr 40px;
    }
    .cb-leader-row .cb-bar-container { display: none; }
    .cb-spell-row {
        grid-template-columns: 24px 1fr 36px;
    }
    .cb-spell-row .cb-bar-container { display: none; }
}

/* ── Guild Selector ──────────────────────────────────────────────────────────*/
.guild-select-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.guild-selector-dropdown {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.15s;
}

.guild-selector-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

.guild-selector-dropdown:hover {
    border-color: var(--primary-color);
}

/* Force option elements to always use safe readable colors
   regardless of theme — browsers render option dropdowns
   with OS-native backgrounds so we must hardcode these */
.guild-selector-dropdown option,
select option {
    background-color: #1e1e2e;
    color: #e2e2e2;
}

/* Also fix all other selects on the page */
select {
    color-scheme: dark;
}
