/* ============================================================
   SOULSPECTRE – Unit Pages  |  Shared Stylesheet (Barog layout)
   Reference: valkyrion_hero_barog.html
   Override per-unit via:  document.documentElement.style.setProperty(...)
   done automatically by unit-renderer.js from the JSON "accent" field.
   ============================================================ */

:root {
    --accent-color: #4dd0e1;
    --accent-glow:  rgba(77, 208, 225, 0.3);
    --stat-hp:      #4CAF50;
    --stat-atk:     #f44336;
    --panel-bg:     rgba(15, 20, 15, 0.85);
    --nav-bg:       rgba(5, 5, 5, 0.95);
}

/* ── Base ─────────────────────────────────────────────────────────── */
body {
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #050505;
}

#bg-image {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-size: cover; background-position: center;
    z-index: -2; filter: brightness(0.15);
}

#overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, transparent, rgba(0,0,0,0.9));
    z-index: -1;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
    position: fixed; top: 0; left: -320px; width: 300px; height: 100vh;
    background: rgba(10, 10, 15, 0.98); border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 1001; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; padding: 80px 0 20px 0;
    box-shadow: 20px 0 50px rgba(0,0,0,0.8); overflow-y: auto;
}
.sidebar.active { left: 0; }

.close-sidebar {
    position: absolute; top: 15px; right: 20px; background: none; border: none;
    color: #888; font-size: 1.5rem; cursor: pointer; transition: 0.3s;
}
.close-sidebar:hover { color: #fff; }

.accordion-btn {
    background: transparent; color: #ccc; border: none; width: 100%;
    text-align: left; padding: 18px 30px; font-size: 0.95rem;
    text-transform: uppercase; letter-spacing: 2px; font-weight: bold;
    cursor: pointer; transition: all 0.3s ease; border-left: 3px solid transparent;
    display: flex; justify-content: space-between; align-items: center;
}
.accordion-btn:hover { background: rgba(255,255,255,0.03); color: #fff; }
.accordion-btn.active { background: rgba(255,255,255,0.05); color: #fff; border-left-color: var(--accent-color); }

.chevron { font-size: 0.8rem; transition: transform 0.3s ease; }
.accordion-btn.active .chevron { transform: rotate(180deg); color: var(--accent-color); }

.accordion-content {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.5);
}

.sub-link {
    display: block; padding: 12px 30px 12px 50px; color: #888;
    text-decoration: none; font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 1px; border-left: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}
.sub-link:hover { color: var(--accent-color); padding-left: 55px; background: rgba(255,255,255,0.03); }

.sub-link.locked { color: #444; cursor: not-allowed; }
.sub-link.locked:hover { color: #555; padding-left: 50px; background: none; }
.sub-link.locked::after { content: " [LOCKED]"; font-size: 0.65rem; letter-spacing: 0; }

.direct-link {
    display: block; padding: 18px 30px; color: #ccc; text-decoration: none;
    text-transform: uppercase; letter-spacing: 2px; font-weight: bold;
    border-left: 3px solid transparent; transition: all 0.3s ease;
}
.direct-link:hover { background: rgba(255,255,255,0.05); color: #fff; border-left-color: var(--accent-color); }

.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); z-index: 1000; opacity: 0; visibility: hidden;
    transition: all 0.3s ease; backdrop-filter: blur(2px);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ── Breadcrumbs ──────────────────────────────────────────────────── */
.breadcrumbs {
    width: 100%; max-width: 1000px; margin: 20px auto 0 auto; padding: 0 20px;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #666;
    box-sizing: border-box;
}
.breadcrumbs a { color: #888; text-decoration: none; transition: color 0.3s; }
.breadcrumbs a:hover { color: #fff; }
.breadcrumbs span { color: var(--accent-color); font-weight: bold; }

/* ── Header ───────────────────────────────────────────────────────── */
header { padding: 30px 20px; text-align: center; width: 100%; box-sizing: border-box; }

h1 {
    letter-spacing: 5px; font-size: 2.8rem; margin: 0; color: #fff;
    text-transform: uppercase; text-shadow: 0 0 15px var(--accent-glow);
}

.classification {
    color: var(--accent-color); font-size: 1.1rem; letter-spacing: 2px;
    margin-top: 5px; text-transform: uppercase; font-weight: bold;
}

/* ── Main ─────────────────────────────────────────────────────────── */
main { max-width: 1400px; padding: 0 20px 40px 20px; width: 95%; box-sizing: border-box; }

/* ── Hero card ────────────────────────────────────────────────────── */
.hero-card {
    display: flex; gap: 0; margin-bottom: 40px; background: var(--panel-bg);
    backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8); border-radius: 4px; overflow: hidden;
    min-height: 550px;
}
.combat-container {
    flex: 0 0 35%; position: relative; border-right: 2px solid var(--accent-color); max-width: 500px;
}
.combat-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.combat-container img:first-child { position: relative; }
.combat-anim { animation: crossfade-combat 8s infinite; }
@keyframes crossfade-combat { 0%,40%{opacity:0} 50%,90%{opacity:1} 100%{opacity:0} }

.combat-anim2 { animation: crossfade-combat2 12s infinite; }
.combat-container .combat-anim2:nth-child(1) { animation-delay:   0s; }
.combat-container .combat-anim2:nth-child(2) { animation-delay:  -8s; }
.combat-container .combat-anim2:nth-child(3) { animation-delay:  -4s; }
@keyframes crossfade-combat2 {
    0%, 30%  { opacity: 1 }
    38%      { opacity: 0 }
    92%      { opacity: 0 }
    100%     { opacity: 1 }
}


.hero-content { flex: 1; padding: 40px; display: flex; flex-direction: column; }

.hero-bio {
    margin-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px;
}
.hero-bio h2 { color: #fff; margin-top: 0; text-transform: uppercase; letter-spacing: 2px; }
.hero-bio p  { color: #bbb; font-style: italic; font-size: 1.05rem; margin: 0 0 10px; }
.hero-bio p:last-child { margin-bottom: 0; }

/* ── Stats ────────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.stat-item {
    background: rgba(255,255,255,0.03); padding: 12px; border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.05);
}
.stat-label { display: block; color: #666; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { display: block; color: #fff; font-size: 1.3rem; font-weight: bold; font-family: monospace; }
.stat-value.hp      { color: var(--stat-hp); }
.stat-value.atk     { color: var(--stat-atk); }
.stat-value.special { color: #64B5F6; font-size: 1rem; }
.stat-value.tier    { color: var(--accent-color); }

/* ── Skills ───────────────────────────────────────────────────────── */
.skills-section-title {
    text-transform: uppercase; letter-spacing: 3px; color: #555;
    border-bottom: 1px solid #222; padding-bottom: 10px;
    font-size: 1rem; margin: 0 0 15px;
}

.skills-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 40px; }

.skill-item {
    display: flex; align-items: center; background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05); border-left: 4px solid #333;
    padding: 20px; transition: all 0.3s ease;
}
.skill-item:hover {
    background: rgba(255,255,255,0.04);
    border-left-color: var(--accent-color);
    transform: translateX(10px);
    box-shadow: -10px 0 20px var(--accent-glow);
}

/* border-left colour per type */
.skill-item.sk-base     { border-left-color: #666; }
.skill-item.sk-active   { border-left-color: var(--accent-color); }
.skill-item.sk-passive  { border-left-color: #a5d6a7; }
.skill-item.sk-ultimate { border-left-color: #ce93d8; }
.skill-item.sk-attack   { border-left-color: var(--stat-atk); }

.skill-icon {
    width: 70px; height: 70px; margin-right: 25px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1); padding: 3px; background: #000;
    filter: grayscale(0.5); transition: 0.3s; box-sizing: border-box;
}
.skill-item:hover .skill-icon { filter: grayscale(0); border-color: var(--accent-color); }

.skill-info { flex: 1; }

.skill-header {
    display: flex; align-items: center; gap: 15px; margin-bottom: 5px;
}

.skill-name { color: #fff; font-size: 1.3rem; text-transform: uppercase; margin: 0; }

.skill-tag {
    font-size: 0.7rem; color: #777; border: 1px solid #444;
    padding: 2px 6px; text-transform: uppercase;
}
.skill-tag.active   { color: var(--accent-color); border-color: var(--accent-color); background: rgba(77,208,225,0.08); }
.skill-tag.passive  { color: #a5d6a7; border-color: #a5d6a7; background: rgba(165,214,167,0.08); }
.skill-tag.ultimate { color: #ce93d8; border-color: #ce93d8; background: rgba(206,147,216,0.08); }
.skill-tag.attack   { color: var(--stat-atk); border-color: var(--stat-atk); background: rgba(244,67,54,0.08); }

.skill-desc { color: #aaa; font-size: 1rem; margin: 0; }

/* ── Inline tags ──────────────────────────────────────────────────── */
.highlight  { color: var(--accent-color); font-weight: bold; }

.dmg-phys   { color: #ff8a65; font-weight: bold; }
.dmg-light  { color: #fff176; font-weight: bold; }
.dmg-fire   { color: #ff7043; font-weight: bold; }
.dmg-earth  { color: #a5d6a7; font-weight: bold; }
.dmg-air    { color: #80deea; font-weight: bold; }
.dmg-shadow { color: #b39ddb; font-weight: bold; }
.dmg-poison { color: #aed581; font-weight: bold; }
.dmg-mind   { color: #f48fb1; font-weight: bold; }
.dmg-pure   { color: #e0e0e0; font-weight: bold; }
.dmg-dark   { color: #b39ddb; font-weight: bold; }
.heal-tag   { color: #69f0ae; font-weight: bold; }

/* ── Portrait gallery ─────────────────────────────────────────────── */
.portrait-gallery-module {
    background: rgba(10,18,12,0.7); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.05); border-left: 3px solid var(--accent-color);
    padding: 35px; margin-bottom: 40px;
}
.gallery-header {
    color: #fff; letter-spacing: 2px; text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
    margin: 0 0 25px;
}
.carousel-wrap { position: relative; overflow: hidden; }
.carousel-track { display: flex; gap: 15px; transition: transform 0.35s ease; padding: 5px 2px; }
.carousel-item  { flex: 0 0 200px; height: 260px; border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; background: #000; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.carousel-nav { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.nav-btn {
    background: rgba(10,18,12,0.9); border: 1px solid var(--accent-color);
    color: var(--accent-color); width: 44px; height: 44px; border-radius: 50%;
    cursor: pointer; font-size: 1.2rem; display: flex; align-items: center;
    justify-content: center; transition: all 0.2s;
}
.nav-btn:hover { background: var(--accent-color); color: #000; }

/* ── Back link ────────────────────────────────────────────────────── */
.back-link {
    display: block; text-align: center; margin-top: 40px; color: #555;
    text-decoration: none; padding: 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 1px; transition: color 0.3s;
}
.back-link:hover { color: var(--accent-color); }

/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.92);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.25s ease;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-img { max-width: 90vw; max-height: 88vh; object-fit: contain; border-radius: 2px; }
.lightbox-close {
    position: absolute; top: 20px; right: 28px; background: none; border: none;
    color: #fff; font-size: 2.5rem; cursor: pointer; line-height: 1;
    opacity: 0.7; transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 850px) {
    .hero-card { flex-direction: column; }
    .combat-container { flex: 0 0 400px; border-right: none; border-bottom: 2px solid var(--accent-color); }
    .skill-item:hover { transform: translateY(-5px); }
}


/* ── Ultrawide & 4K Scaling ───────────────────────────────────────── */
@media (min-width: 1920px) {
    .hero-card { min-height: 700px; }
    .combat-container { max-width: 700px; }
    .carousel-item { flex: 0 0 300px; height: 360px; }
    .skill-icon { width: 90px; height: 90px; }
}
