/* ==========================================================================
   PAGE: COMPARE (CONSOLIDATED - All Compare Styles)
   ========================================================================== */

/* Override body background for cosmic background pages */
body {
    background-color: transparent !important;
    background-image: none !important;
}

/* --- Header Fade-in Animation --- */
@keyframes headerFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    animation: headerFadeIn 1s ease-out;
}

/* --- Page Layout & Header --- */
.page-container {
    max-width: 87.5rem;
    margin: 0 auto;
    padding: 1.5rem; /* Reduced from 2rem */
}

.page-header {
    text-align: center;
    margin-bottom: 1.5rem; /* Further reduced margin */
    padding: 1.5rem 1.25rem; /* Further reduced padding */
    background-color: #0d1117; /* Darker base */
    border: 1px solid #30363d;
    border-radius: 0.75rem; /* Slightly smaller radius */
    position: relative;
    overflow: hidden;
    /* Add a subtle background pattern */
    background-image: linear-gradient(rgba(22, 27, 34, 0.95), rgba(22, 27, 34, 0.95)), url("https://www.transparenttextures.com/patterns/cubes.png");
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.page-header:hover {
    border-color: #484f58;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.3);
}

/* Add a "shine" effect */
.page-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 60%);
    transform: rotate(30deg);
    transition: opacity 0.6s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

.page-header:hover::after {
    opacity: 1;
}

.page-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem; /* Further reduced from 3.5rem */
    margin-bottom: 0.4rem;
    color: #ffffff;
    text-shadow: 0 0 0.9375rem rgba(47, 129, 247, 0.6), 0 0 1.5625rem rgba(47, 129, 247, 0.4); /* Enhanced glow */
    position: relative;
    z-index: 1;
    letter-spacing: 0.0938rem; /* Added letter spacing */
}

.page-header p {
    font-size: 1rem; /* Further reduced from 1.1rem */
    color: #a1aab4;
    max-width: 32rem; /* Further reduced max-width */
    margin: 0 auto;
    position: relative;
    z-index: 1;
    font-weight: 400; /* Lighter font weight */
}

.page-title {
    text-align: center;
    color: #ffffff;
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

/* --- Main Comparison Container --- */
.comparison {
    max-width: 100rem;
    margin: 0 auto 4rem auto; /* Reduced bottom margin from 8rem to 4rem */
    padding: 1.25rem; /* Reduced from 1.5rem */
    background-color: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    border: 1px solid var(--accent-cyan-faded);
    border-radius: 0.75rem;
    box-shadow: 0 0 1.875rem rgba(0, 255, 255, 0.1);
    visibility: hidden; /* Hidden by default, shown by JS */
    position: relative;
    overflow: hidden;
}


.comparison::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 170, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 179, 237, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(0, 170, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.comparison-tip {
    grid-column: 1 / -1;
    text-align: center;
    padding-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- UI ACTIONS --- */
.comparison__actions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.comparison__actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 170, 255, 0.3) 50%, transparent 100%);
}

#share-comparison-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

#share-comparison-btn.is-success {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
}

#share-comparison-btn.is-error {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

/* --- SKELETON LOADER --- */
#skeleton-loader {
    display: grid;
    grid-template-columns: minmax(11.25rem, 0.7fr) repeat(4, 1fr);
    gap: 0.25rem 1rem;
    width: 100%;
}
.skeleton-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  padding: 0.75rem 0;
}
.skeleton-row.skeleton-header { padding-bottom: 1.25rem; }
.skeleton-label, .skeleton-card, .skeleton-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  position: relative;
  overflow: hidden;
}
.skeleton-label { height: 1.5rem; width: 80%; }
.skeleton-card { height: 11.25rem; }
.skeleton-item { height: 3rem; }

.skeleton-label::after,
.skeleton-card::after,
.skeleton-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* --- Main Comparison Grid Layout --- */
.comparison__grid {
    display: grid;
    grid-template-columns: minmax(11.25rem, 0.7fr) repeat(4, 1fr);
    gap: 0.25rem 1rem; /* Tighter vertical gap */
    width: 100%;
}

.comparison__row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

/* Provide visual feedback on hover for data rows */
.comparison__row:not(.comparison__row--header):not(.comparison__row--section-title):hover {
    background-color: rgba(0, 255, 255, 0.07); /* Slightly more visible */
    transform: scale(1.01); /* Subtle zoom effect */
    transition: transform 0.2s ease, background-color 0.2s ease; /* Add transition for smoothness */
}

/* --- Animations --- */
@keyframes fadeInZoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOutZoomOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

.comparison__row {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-in {
    animation: fadeInZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.is-removing {
    animation: fadeOutZoomOut 0.3s ease-out forwards;
}

/* --- Row Modifiers --- */
/* Style the header row to visually separate it from the data rows */
.comparison__row--header {
    align-items: stretch;
    margin-bottom: 1.5rem; /* Increased margin */
    background-color: rgba(0, 255, 255, 0.03); /* Subtle background tint */
    border-radius: 0.5rem;
}

/* Make section titles more prominent */
.comparison__row--section-title {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, var(--accent-cyan-faded) 0%, transparent 100%);
    margin: 2.5rem 0 1.25rem 0; /* Increased margin */
    padding: 0.75rem 1.5rem; /* Increased padding */
    border-left: 0.25rem solid var(--accent-cyan); /* Bolder border */
}

.comparison__row--section-title h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem; /* Larger font size */
    color: var(--text-primary);
    letter-spacing: 1.5px; /* Increased letter spacing */
    text-shadow: 0 0 0.5rem var(--accent-cyan); /* Stronger text shadow */
}

/* --- Header & Placeholder --- */
.comparison__column-header {
    position: relative;
}
.comparison__header {
    height: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background-size: cover;
    background-position: center 20%;
    transition: all 0.3s ease;
    border: 0.125rem solid transparent;
}
.comparison__header:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,0.4);
}
.comparison__header.is-baseline {
    border-color: var(--accent-gold);
    box-shadow: 0 0 1.5625rem var(--accent-gold);
    transform: translateY(-0.125rem) scale(1.02);
}

.comparison__header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    text-align: center;
}
.comparison__header-overlay h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    text-shadow: 0 1px 0.1875rem #000;
}
.comparison__role-badge {
    font-size: 0.7rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.3125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: inline-block;
    color: #fff;
    border: 1px solid rgba(0,0,0,0.3);
}
.comparison__role-badge--vanguard { background-color: var(--accent-blue); }
.comparison__role-badge--duelist { background-color: var(--accent-red); }
.comparison__role-badge--strategist { background-color: var(--accent-green); }

.comparison__remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: none;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 10;
}
.comparison__remove-btn:hover {
    background-color: var(--accent-red);
    transform: scale(1.1);
}

.comparison__placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 9.375rem;
    border: 0.125rem dashed var(--border-color);
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}
.comparison__placeholder:hover {
    background-color: rgba(0, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    transform: scale(1.02);
}
.select-hero-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    transition: color 0.2s ease;
}
.select-hero-btn:hover {
    color: var(--accent-cyan);
}
.select-hero-btn svg {
    width: 1.75rem;
    height: 1.75rem;
}

/* --- Grid Cells --- */
/* Improve readability of the row labels in the first column */
.comparison__label-cell {
    grid-column: 1 / 2;
    padding: 0.75rem 1rem;
    font-weight: 700; /* Bolder */
    font-size: 0.95rem; /* Slightly larger */
    color: var(--text-primary); /* Higher contrast */
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.comparison__label-cell svg {
    width: 1em;
    height: 1em;
    fill: var(--text-secondary);
}

.comparison__row--sub-item .comparison__label-cell {
    padding-left: 2.5rem;
    font-weight: 600; /* Bolder */
    font-size: 0.9rem; /* Slightly larger */
    color: var(--text-secondary); /* Keep it secondary, but parent is now primary */
}

.comparison__cell {
    padding: 0.5rem;
    text-align: center;
    min-height: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
    font-size: 1rem; /* Larger font size */
    color: var(--text-primary);
}

/* --- Stat Comparison Indicators --- */
.comparison__cell--is-highest {
    color: var(--accent-gold);
    font-weight: 700;
    text-shadow: 0 0 0.8rem var(--accent-gold), 0 0 1rem var(--accent-gold);
    transform: scale(1.1);
}

.comparison__cell--is-better {
    color: #33ff99; /* Vibrant Green */
}

.comparison__cell--is-worse {
    color: #ff4d4d; /* Vibrant Red */
}

/* Use ::before to add indicator arrows without changing JS */
.comparison__cell--is-better::before,
.comparison__cell--is-worse::before {
    display: inline-block;
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 0.4rem;
    vertical-align: middle; /* Align with text */
}

.comparison__cell--is-better::before {
    content: '▲';
}

.comparison__cell--is-worse::before {
    content: '▼';
}

/* Ensure indicators don't mess up flexbox centering in cells */
.comparison__cell {
    /* ... existing styles ... */
    flex-direction: row; /* Change from column to row */
    justify-content: center;
    align-items: center;
}
.comparison__stat-bar-container + span {
    margin-left: 0.5rem;
}

/* --- STAT BARS & Difficulty Stars --- */
.comparison__stat-bar-container {
    width: 90%;
    height: 0.875rem; /* Slightly thicker for better visibility */
    background-color: rgba(13, 17, 23, 0.7); /* Dark, glassy background */
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    border: 1px solid rgba(0, 255, 255, 0.2); /* Subtle cyan border */
    position: relative;
    overflow: hidden; /* Ensures pseudo-elements are contained */
    box-shadow: inset 0 0 0.3125rem rgba(0, 0, 0, 0.5); /* Inner shadow for depth */
}

.comparison__stat-bar {
    height: 100%;
    background-size: 200% 100%; /* For animating the gradient */
    border-radius: 0.4375rem;
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1); /* Smoother, more dynamic transition */
    position: relative; /* Required for the ::after pseudo-element */
    overflow: hidden; /* Hide the parts of the sheen that are outside the bar */
    animation: gradient-flow 4s ease infinite; /* Added gradient animation */
}

.comparison__stat-bar--health {
    background: linear-gradient(90deg, #28a745, #20c997, #90ee90);
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #20c997,
                0 0 0.625rem #28a745,
                0 0 1.25rem #90ee90;
}

.comparison__stat-bar--speed {
    background: linear-gradient(90deg, #007bff, #00BFFF, #87CEEB);
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #00BFFF,
                0 0 0.625rem #007bff,
                0 0 1.25rem #87CEEB;
}

/* Sheen / Scanline effect */
.comparison__stat-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%; /* Start off-screen */
    width: 75%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    transform: skewX(-25deg); /* Angled sheen */
    animation: scan-sheen 3s ease-in-out infinite;
    animation-delay: 0.5s; /* Stagger the animation */
}

.comparison__stat-bar--cooldown {
    background: linear-gradient(90deg, #33ff99, #ffd700, #ff6347);
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #33ff99,
                0 0 0.625rem #ffd700,
                0 0 1.25rem #ff6347;
}

.comparison__stat-bar--mobility {
    background: linear-gradient(90deg, #ff6b6b, #ffa500, #ffd700);
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #ff6b6b,
                0 0 0.625rem #ffa500,
                0 0 1.25rem #ffd700;
}

/* --- Effective Range Bar Color Coding --- */
.comparison__stat-bar--range-close {
    background: linear-gradient(90deg, #ff4d4d, #ff6b6b, #ff8a8a) !important;
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #ff4d4d,
                0 0 0.625rem #ff6b6b,
                0 0 1.25rem #ff8a8a !important;
}

.comparison__stat-bar--range-mid {
    background: linear-gradient(90deg, #ffd700, #ffed4e, #fff176) !important;
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #ffd700,
                0 0 0.625rem #ffed4e,
                0 0 1.25rem #fff176 !important;
}

.comparison__stat-bar--range-long {
    background: linear-gradient(90deg, #33ff99, #66ffaa, #99ffbb) !important;
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #33ff99,
                0 0 0.625rem #66ffaa,
                0 0 1.25rem #99ffbb !important;
}

.comparison__stat-bar--range-unknown {
    background: linear-gradient(90deg, #a1aab4, #b8c1ca, #cfd6dd) !important;
    box-shadow: 0 0 0.125rem #fff,
                0 0 0.3125rem #a1aab4,
                0 0 0.625rem #b8c1ca,
                0 0 1.25rem #cfd6dd !important;
}

/* Hero card range bar colors */
.hero-card__stat-bar--range-close {
    background: linear-gradient(90deg, #ff4d4d, #ff6b6b, #ff8a8a) !important;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.4) !important;
}

.hero-card__stat-bar--range-mid {
    background: linear-gradient(90deg, #ffd700, #ffed4e, #fff176) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4) !important;
}

.hero-card__stat-bar--range-long {
    background: linear-gradient(90deg, #33ff99, #66ffaa, #99ffbb) !important;
    box-shadow: 0 0 8px rgba(51, 255, 153, 0.4) !important;
}

.hero-card__stat-bar--range-unknown {
    background: linear-gradient(90deg, #a1aab4, #b8c1ca, #cfd6dd) !important;
    box-shadow: 0 0 8px rgba(161, 170, 180, 0.4) !important;
}

.comparison__cell span {
    font-size: 0.9rem;
    font-weight: 600;
}

.difficulty-stars {
    font-size: 1.2rem;
    color: var(--accent-gold);
    letter-spacing: 0.125rem;
}

.difficulty-stars ☆ {
    color: var(--text-secondary);
}

/* --- FULL GUIDE LINK --- */
.comparison__full-guide-link {
    font-size: 0.9rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.comparison__full-guide-link:hover {
    color: var(--accent-cyan);
}

/* --- EMPTY STATE & UI ACTIONS --- */
/* Style the empty state to be more visually engaging */
.comparison__empty-state {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 70vh;
    grid-column: 1 / -1;
    position: relative;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 170, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 179, 237, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(0, 170, 255, 0.05) 0%, transparent 50%);
    border-radius: 20px;
    border: 1px solid rgba(0, 170, 255, 0.2);
    margin: 2rem 0;
    overflow: hidden;
}

.comparison__empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(0, 170, 255, 0.03) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(99, 179, 237, 0.02) 50%, transparent 70%);
    animation: backgroundShift 15s ease-in-out infinite;
    pointer-events: none;
}
.comparison--is-empty .comparison__empty-state {
    display: none;
}
.empty-state-icon {
    width: 6rem;
    height: 6rem;
    color: var(--accent-cyan);
    opacity: 0.8;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px rgba(0, 170, 255, 0.4));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}
.comparison--is-empty .comparison__grid,
.comparison--is-empty .comparison-tip {
    display: none;
}

.comparison--is-empty .hero-cards-container {
    display: block;
}
.empty-state-content { 
    max-width: 35rem; 
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 2;
    padding: 3rem 2rem;
}

.empty-state-content h2 { 
    font-family: var(--font-display); 
    font-size: 3.5rem; 
    margin-bottom: 1rem; 
    color: #fff; 
    text-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
    background: linear-gradient(135deg, #ffffff 0%, #00aaff 50%, #63b3ed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(0, 170, 255, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(0, 170, 255, 0.6));
    }
}

.empty-state-content p { 
    font-size: 1.2rem; 
    color: #a0aec0; 
    margin-bottom: 2.5rem; 
    line-height: 1.6;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}
#start-comparing-btn { 
    font-size: 1.1rem; 
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #00aaff 0%, #63b3ed 100%);
    border: 2px solid rgba(0, 170, 255, 0.5);
    border-radius: 12px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(0, 170, 255, 0.3),
        0 0 20px rgba(0, 170, 255, 0.2);
    animation: buttonGlow 2s ease-in-out infinite alternate;
}

@keyframes buttonGlow {
    0% {
        box-shadow: 
            0 8px 25px rgba(0, 170, 255, 0.3),
            0 0 20px rgba(0, 170, 255, 0.2);
    }
    100% {
        box-shadow: 
            0 12px 35px rgba(0, 170, 255, 0.4),
            0 0 30px rgba(0, 170, 255, 0.3);
    }
}

#start-comparing-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #63b3ed 0%, #00aaff 100%);
    box-shadow: 
        0 15px 40px rgba(0, 170, 255, 0.4),
        0 0 40px rgba(0, 170, 255, 0.3);
}

#start-comparing-btn:active {
    transform: translateY(-1px) scale(1.02);
}

#start-comparing-btn svg { 
    margin-right: 0.75rem; 
    width: 1.5rem; 
    height: 1.5rem; 
    animation: iconSpin 2s linear infinite;
}

@keyframes iconSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- Empty State Enhancements --- */
.empty-state-icon-wrapper {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.15) 0%, rgba(99, 179, 237, 0.1) 100%);
    border-radius: 50%;
    margin-bottom: 2rem;
    display: inline-block;
    animation: iconWrapperPulse 3s ease-in-out infinite;
    border: 2px solid rgba(0, 170, 255, 0.3);
    box-shadow: 
        0 0 30px rgba(0, 170, 255, 0.2),
        inset 0 0 20px rgba(0, 170, 255, 0.1);
}

@keyframes iconWrapperPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 30px rgba(0, 170, 255, 0.2),
            inset 0 0 20px rgba(0, 170, 255, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 0 40px rgba(0, 170, 255, 0.3),
            inset 0 0 25px rgba(0, 170, 255, 0.15);
    }
}

.empty-state-content h2 {
    font-size: 2.5rem;
    color: var(--text-bright);
    text-shadow: 0 0 10px var(--accent-cyan);
}

.empty-state-content p {
    font-size: 1.1rem;
    max-width: 45ch;
    margin-left: auto;
    margin-right: auto;
}

#start-comparing-btn {
    font-size: 1rem;
    padding: 0.8rem 1.6rem;
    box-shadow: 0 0 15px var(--accent-cyan-faded);
    border-color: var(--accent-cyan);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 170, 255, 0.2);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 170, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 170, 255, 0);
    }
}

/* --- HERO CARDS LAYOUT - Vertical Card Format --- */

/* Hide the old grid layout when using hero cards */
.comparison--using-cards .comparison__grid {
    display: none;
}

.comparison--using-cards .comparison-tip {
    display: none;
}

/* Hero Cards Container */
.hero-cards-container {
    display: none;
    max-width: 100rem;
    margin: 2rem auto;
    padding: 1.5rem;
}

.comparison--using-cards .hero-cards-container {
    display: block;
}

.hero-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
    margin: 0;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 2;
    grid-template-rows: 1fr;
    align-items: stretch;
}

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

/* Individual Hero Card */
.hero-card {
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.9) 0%, rgba(15, 20, 30, 0.95) 100%);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: float 6s ease-in-out infinite;
    animation-delay: calc(var(--card-index, 0) * 0.2s);
    width: 100%;
    height: 420px; /* Reduced from 500px */
    min-height: 420px; /* Reduced from 500px */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 170, 255, 0.2);
    border-color: rgba(0, 170, 255, 0.5);
}

/* Hero Card Header with Banner */
.hero-card__header {
    position: relative;
    height: 200px; /* Reduced from 250px */
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 200px; /* Reduced from 250px */
    flex-shrink: 0;
}

.hero-card__banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.3);
    min-width: 100%;
    min-height: 100%;
}

.hero-card__banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 2;
}

.hero-card__remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.hero-card__remove-btn:hover {
    background: rgba(220, 38, 38, 0.8);
    transform: scale(1.1);
}

.hero-card__role-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 170, 255, 0.9);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}

.hero-card__role-badge--vanguard {
    background: rgba(255, 99, 99, 0.9);
}

.hero-card__role-badge--duelist {
    background: rgba(99, 255, 99, 0.9);
}

.hero-card__role-badge--strategist {
    background: rgba(255, 255, 99, 0.9);
    color: #000;
}

/* Hero Name */
.hero-card__name {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 3;
    margin: 0;
}

/* Hero Card Body with Stats */
.hero-card__body {
    padding: 18px; /* Reduced from 24px */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-card__stats {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Reduced from 16px */
}

.hero-card__stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-card__stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-card__stat-label {
    color: #a0aec0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-card__stat-value {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 170, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 170, 255, 0.3);
}

.hero-card__stat-bar-container {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.hero-card__stat-bar {
    height: 100%;
    background: linear-gradient(90deg, #00aaff 0%, #0088cc 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
    position: relative;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
}

.hero-card__stat-bar--high {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.4);
}

.hero-card__stat-bar--medium {
    background: linear-gradient(90deg, #ed8936 0%, #dd6b20 100%);
    box-shadow: 0 0 8px rgba(237, 137, 54, 0.4);
}

.hero-card__stat-bar--low {
    background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%);
    box-shadow: 0 0 8px rgba(245, 101, 101, 0.4);
}

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

/* Placeholder Card for Empty Slots */
.hero-card--placeholder {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border: 2px solid #4a5568;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 420px; /* Reduced from 500px */
    min-height: 420px; /* Reduced from 500px */
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-card--placeholder:hover {
    border-color: #63b3ed;
    background: linear-gradient(135deg, #2a3441 0%, #3a4552 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 179, 237, 0.15);
}

.hero-card--placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(99, 179, 237, 0.08) 50%, transparent 70%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.hero-card--placeholder:hover::before {
    opacity: 1;
}

.hero-card__select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    overflow: hidden;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(99, 179, 237, 0.2);
    backdrop-filter: blur(10px);
}

.hero-card__select-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(99, 179, 237, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hero-card__select-btn:active::before {
    width: 300px;
    height: 300px;
}

.hero-card__select-btn:hover {
    color: #63b3ed;
}

.hero-card__select-btn svg {
    width: 48px;
    height: 48px;
    opacity: 0.7;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    color: #a0aec0;
}

.hero-card__select-btn:hover svg {
    opacity: 1;
    transform: scale(1.05);
    color: #63b3ed;
}

.hero-card__select-btn span {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    color: #a0aec0;
}

/* Baseline hero highlighting */
.hero-card.is-baseline {
    border-color: rgba(0, 170, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
    transform: scale(1.02);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 170, 255, 0.6);
    }
}

.hero-card.is-baseline .hero-card__header {
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.1) 0%, rgba(0, 170, 255, 0.05) 100%);
}

.hero-card.is-baseline .hero-card__name {
    color: #00aaff;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

/* Animation for card appearance */
.hero-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Staggered animation for multiple cards */
.hero-card:nth-child(1) { animation-delay: 0.1s; }
.hero-card:nth-child(2) { animation-delay: 0.2s; }
.hero-card:nth-child(3) { animation-delay: 0.3s; }
.hero-card:nth-child(4) { animation-delay: 0.4s; }

/* --- ABILITY DETAILS MODAL --- */
.ability-button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 11.25rem;
}
.ability-button:hover {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: var(--body-bg);
}

#ability-details-modal .modal-content {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid var(--accent-cyan-faded);
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    box-shadow: 0 0 2.5rem rgba(0, 255, 255, 0.2);
}
.ability-detail-header { display: flex; align-items: center; gap: 0.9375rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.9375rem; margin-bottom: 0.9375rem; }
.ability-detail-hero-icon { width: 3.125rem; height: 3.125rem; border-radius: 50%; border: 0.125rem solid #fff; object-fit: cover; }
.ability-detail-name { margin: 0; font-family: var(--font-display); font-size: 2rem; color: var(--accent-cyan); }
.ability-detail-keybind { background-color: #fff; color: #1a202c; padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-weight: 700; font-size: 0.9rem; }
.ability-detail-description { font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
.ability-detail-stats { margin-top: 1.25rem; display: grid; gap: 0.625rem; background-color: rgba(0, 0, 0, 0.3); padding: 0.9375rem; border-radius: 0.5rem; }
.ability-detail-stats div { display: flex; justify-content: space-between; font-size: 1rem; }
.ability-detail-stats strong { color: var(--text-secondary); }
.ability-detail-stats span { font-weight: 700; }

/* --- HERO SELECT MODAL --- */
#hero-select-modal .modal-content { max-width: 90vw; width: 56.25rem; height: 85vh; display: flex; flex-direction: column; }
.modal-search-wrapper {
    position: relative;
    margin-bottom: 1rem;
}
.modal-search {
    /* Assuming some base styles from global.css, adding specifics here */
    width: 100%;
    padding-right: 2.5rem; /* Space for the clear button */
    box-sizing: border-box;
}
.modal-search-clear-btn {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}
.modal-search-clear-btn:hover {
    color: var(--text-primary);
}
.hero-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.625rem, 1fr)); gap: 1rem; padding-top: 1rem; overflow-y: auto; flex-grow: 1; scrollbar-width: thin; scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.1); }
.hero-select-grid::-webkit-scrollbar { width: 0.5rem; }
.hero-select-grid::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 0.25rem; }
.hero-select-grid::-webkit-scrollbar-thumb { background-color: var(--accent-cyan); border-radius: 0.25rem; border: 0.125rem solid transparent; background-clip: content-box; }
.hero-select-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; text-decoration: none; color: var(--text-secondary); background-color: transparent; border: 0.125rem solid transparent; transition: all 0.2s ease; }
.hero-select-item:hover { background-color: rgba(255, 255, 255, 0.05); border-color: var(--accent-cyan-faded); transform: translateY(-0.125rem); }
/* Add a visual indicator for selected heroes in the modal */
.hero-select-item.is-selected {
    background-color: rgba(0, 255, 255, 0.1);
    border-color: var(--accent-cyan);
    pointer-events: none;
    opacity: 0.7;
    transform: scale(1.05); /* Add a scale transform */
}
.hero-select-item img { width: 4.375rem; height: 4.375rem; border-radius: 50%; object-fit: cover; border: 0.125rem solid var(--border-color); box-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.3); }
.hero-select-item .hero-name { font-size: 0.8rem; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Keyframes for the new animations */
@keyframes scan-sheen {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

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

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1200px) {
    .hero-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 2.2rem; /* Reduced from 2.5rem */
    }
    
    .page-header p {
        font-size: 0.9rem; /* Reduced from 1rem */
        max-width: 26rem; /* Reduced from 28rem */
    }
    
    .comparison {
        padding: 1rem;
        margin: 1rem;
    }

    .comparison__grid {
        display: block;
    }

    .comparison__row {
        display: block;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .comparison__row--header,
    .comparison__row--section-title {
        display: none;
    }

    .comparison__label-cell {
        display: block;
        font-weight: 700;
        margin-bottom: 0.5rem;
        padding: 0;
        border-bottom: none;
    }

    .comparison__cell {
        display: block;
        text-align: right;
        padding: 0.5rem 0;
        min-height: auto;
        border-bottom: 1px solid var(--border-color);
    }

    .comparison__cell:last-child {
        border-bottom: none;
    }

    .comparison-tip,
    .comparison__actions {
        padding: 1rem 0;
    }

    .hero-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-card__header {
        height: 140px; /* Reduced from 160px */
    }
    
    .hero-card__name {
        font-size: 18px; /* Reduced from 20px */
    }
    
    .hero-card__body {
        padding: 16px; /* Reduced from 20px */
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 0.5rem;
    }
    
    .page-header {
        padding: 1rem 0.75rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem; /* Reduced from 2rem */
    }
    
    .page-header p {
        font-size: 0.85rem; /* Reduced from 0.9rem */
        max-width: 22rem; /* Reduced from 25rem */
    }
    
    .comparison {
        margin: 0;
        border-radius: 0;
        border: none;
    }

    .hero-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero-cards-container {
        padding: 1rem;
    }
    
    .hero-card__header {
        height: 120px; /* Reduced from 140px */
    }
    
    .hero-card__name {
        font-size: 16px; /* Reduced from 18px */
    }
    
    .hero-card__body {
        padding: 14px; /* Reduced from 16px */
    }
}


/* Enhanced Button Styles */
.comparison__actions button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(0);
}

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

.comparison__actions button:active {
    transform: translateY(2px);
}

.comparison__actions button:active::before {
    width: 300px;
    height: 300px;
}

/* Enhanced Hero Card Hover Effects */
.hero-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 170, 255, 0.3);
    border-color: rgba(0, 170, 255, 0.6);
}

.hero-card:hover .hero-card__banner {
    transform: scale(1.05);
}

.hero-card:hover .hero-card__stat-bar {
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.6);
}

/* Enhanced Stat Bar Animations */
.hero-card__stat-bar {
    position: relative;
    overflow: hidden;
}

.hero-card__stat-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: statShimmer 3s infinite;
}

@keyframes statShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
