/*
Theme Name: Ethoria Theme (Arcane Glass)
Theme URI: https://talesofethoria.com/
Author: Ethoria Engine
Description: A high-fidelity, stunning fantasy interface with glassmorphism and deep atmosphere.
Version: 3.5.2
License: GNU General Public License v2 or later
Text Domain: ethoria-theme
*/

/* =========================
   ROOT VARIABLES
========================= */
:root {
    --void-deep: #0A0C12;
    --void-mid: #111420;
    --void-light: #1A1F2E;

    --arcane-amethyst: #7C6EE6;
    --amethyst-glow: rgba(124, 110, 230, 0.4);
    --ethereal-teal: #2FA4A9;
    --legendary-gold: #D6B36A;
    --glass-surface: rgba(18, 22, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 12px;

    --text-primary: #ECEFFD;
    --text-secondary: #A5A8C6;
    --text-muted: #6F7396;

    --container-width: 90%;
    --sidebar-width: 320px;
}

/* =========================
   RESET
========================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================
   BASE
========================= */
body {
    background-color: var(--void-deep);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(124,110,230,0.08), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(47,164,169,0.05), transparent 40%);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--arcane-amethyst);
}

/* =========================
   LAYOUT
========================= */
.container {
    width: var(--container-width);
    max-width: 2400px;
    margin: 0 auto;
    padding: 0 20px;
}

.glass-panel {
    background: var(--glass-surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--arcane-amethyst), #5B4BC4);
    color: #fff;
    box-shadow: 0 4px 15px var(--amethyst-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(124,110,230,0.6);
}

/* =========================
   RAIL / CARD SYSTEM
========================= */
.ethoria-rail {
    margin-bottom: 60px;
    position: relative;
    overflow: visible;
}

.rail-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    gap: 25px;
    padding: 30px 40px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.rail-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.rail-card {
    flex: 0 0 calc(25% - 18.75px);
    min-width: 320px;
    scroll-snap-align: start;
    position: relative;
}

/* =========================
   ARCANE CARD (FINAL)
========================= */
.arcane-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
    z-index: 1;

    /* HARD STOP: no scaling, ever */
    transform: none !important;
    will-change: auto;

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.arcane-card:hover {
    transform: none !important;
    border-color: var(--arcane-amethyst);
    background: var(--void-mid);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    z-index: 1;
}

/* =========================
   CARD MEDIA
========================= */
.card-img-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--void-mid);
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    /* no zoom */
    transform: none !important;
    transition: none;
}

/* =========================
   CARD BODY
========================= */
.card-body {
    padding: 20px 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.4;

    min-height: 3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-genre {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--arcane-amethyst);
}

.card-description-hover {
    display: none;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.arcane-card:hover .card-description-hover {
    display: block;
}

/* =========================
   FOOTER / HOVER ACTIONS
========================= */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
    margin-top: auto;
}

.arcane-card:hover .card-footer {
    opacity: 0;
    visibility: hidden;
}

.card-hover-actions {
    position: absolute;
    bottom: 25px;
    left: 25px;
    right: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--arcane-amethyst);
    padding-top: 15px;
    opacity: 0;
    visibility: hidden;
}

.arcane-card:hover .card-hover-actions {
    opacity: 1;
    visibility: visible;
}

/* =========================
   ICON BUTTONS
========================= */
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn:hover {
    border-color: var(--arcane-amethyst);
    box-shadow: 0 0 10px var(--amethyst-glow);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1400px) {
    .rail-card {
        flex: 0 0 calc(33.333% - 17px);
    }
}

@media (max-width: 768px) {
    :root { --container-width: 92%; }

    .rail-card {
        flex: 0 0 85vw;
    }
}

/* =========================
   HERO CINEMATIC (Restored)
========================= */
.hero-cinematic {
    height: 70vh;
    min-height: 650px;
    position: relative;
    margin-bottom: 60px;
    display: flex;
    align-items: flex-end;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-bg img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0; 
    transition: opacity 0.8s ease-in;
}

.hero-bg img.loaded { opacity: 1; }

.hero-overlay-gradient {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(0deg, var(--void-deep) 0%, rgba(10,12,18,0.5) 40%, transparent 100%),
                linear-gradient(90deg, var(--void-deep) 0%, rgba(10,12,18,0.4) 30%, transparent 100%);
    z-index: 1;
}

.hero-content-panel {
    position: relative;
    z-index: 2;
    padding-bottom: 100px;
    max-width: 1000px;
    padding-left: 40px;
}

.hero-featured-label {
    color: var(--legendary-gold);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    display: block;
}

.hero-title-large {
    font-size: 4.5rem;
    margin-bottom: 25px;
    line-height: 1;
}

.hero-tone {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit; 
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================
   RAIL NAVIGATION (Restored)
========================= */
.rail-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: transparent;
    border: 1px solid var(--arcane-amethyst);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.3s;
}

.ethoria-rail:hover .rail-arrow {
    opacity: 1;
}

.rail-arrow.left { left: -30px; }
.rail-arrow.right { right: -30px; }

.rail-arrow:hover {
    background: var(--arcane-amethyst);
    box-shadow: 0 0 20px var(--amethyst-glow);
}

/* =========================
   STORY MODAL
========================= */
.ethoria-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: var(--void-mid);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--arcane-amethyst);
}

.modal-hero {
    position: relative;
    height: 400px;
}

.modal-hero img {
    width: 100%; height: 100%; object-fit: cover;
}

.modal-gradient {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, var(--void-mid) 0%, rgba(17, 20, 32, 0.8) 20%, transparent 100%);
}

.modal-title-block {
    position: absolute;
    bottom: 30px;
    left: 40px;
    right: 40px;
}

.modal-title-block h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.modal-body {
    padding: 40px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-height: 40vh;
    overflow-y: auto;
}

/* =========================
   STEAM-STYLE NAV (Ethoria Palette)
========================= */
.steam-navbar {
  background: var(--void-mid); 
  border-bottom: 1px solid var(--glass-border);
  height: 70px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  font-family: 'Inter', sans-serif;
  overflow: visible;
}

.steam-nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

/* LEFT SIDE */
.nav-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.steam-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 20px;
  text-decoration: none;
}

.brand-logo {
  color: var(--arcane-amethyst);
  font-size: 1.8rem;
  line-height: 1;
}

.brand-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Reset list styles */
.steam-links ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Top-level UL = horizontal row */
.steam-links > ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 28px !important;
}

/* Top-level LIs */
.steam-links > ul > li {
  position: relative !important;
  white-space: nowrap !important;
  padding: 20px 0 !important;
}

/* Top-level links */
.steam-links > ul > li > a {
  display: inline-block !important;
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  padding: 5px 0 !important;
  border-bottom: 2px solid transparent !important;
  text-decoration: none !important;
}

/* Top-level hover/active */
.steam-links > ul > li:hover > a,
.steam-links > ul > li.current-menu-item > a {
  color: var(--text-primary) !important;
  border-bottom-color: var(--arcane-amethyst) !important;
}

/* Submenu UL = hidden dropdown */
.steam-links ul ul {
  display: none !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  min-width: 220px !important;
  background: var(--void-mid) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6) !important;
  padding: 10px 0 !important;
  z-index: 10000 !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

/* Show submenu on hover */
.steam-links li:hover > ul {
  display: flex !important;
}

/* Submenu items */
.steam-links ul ul li {
  width: 100% !important;
  padding: 0 !important;
  position: relative !important; /* Anchor for 3rd level flyout */
}

/* Submenu links (vertical) */
.steam-links ul ul a {
  display: block !important;
  width: 100% !important;
  padding: 12px 20px !important;
  font-size: 0.8rem !important;
  color: var(--text-secondary) !important;
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  border-bottom: none !important;
  white-space: nowrap !important;
}

/* Submenu hover */
.steam-links ul ul a:hover {
  background: rgba(255,255,255,0.05) !important;
  color: var(--arcane-amethyst) !important;
}

/* 3rd level submenu positioning (flyout) */
.steam-links ul ul ul {
  top: -10px !important;
  left: 100% !important;
}

/* RIGHT SIDE */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search */
.steam-search-form {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    margin-right: 15px;
    transition: border-color 0.2s;
}

.steam-search-form:hover {
    border-color: var(--text-muted);
}

.steam-search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-style: italic;
    width: 150px;
    outline: none;
}

.steam-search-input::placeholder {
    color: var(--text-muted);
}

.steam-search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
}

.steam-search-btn:hover {
    color: white;
}

/* Install/Generate Button */
.btn-install {
    background: var(--arcane-amethyst); /* Replaces Steam Green */
    color: white;
    padding: 6px 15px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
    text-decoration: none;
    transition: filter 0.2s;
    margin-right: 10px;
}

.btn-install:hover {
    filter: brightness(1.2);
    color: white;
}

/* User Menu */
.steam-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    padding: 5px;
    color: var(--text-secondary);
}

.steam-user-menu:hover {
    color: var(--text-primary);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 2px; /* Steam uses squares/slight radius, not circles */
    border: 2px solid var(--void-light);
}

.dropdown-arrow {
    font-size: 0.6rem;
    margin-left: 2px;
}

/* Dropdown Content */
.steam-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: var(--void-mid);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    padding: 5px 0;
    z-index: 10000;
    flex-direction: column;
}

.steam-user-menu:hover .steam-dropdown-content {
    display: flex;
}

.steam-dropdown-content a {
    padding: 8px 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: none;
}

.steam-dropdown-content a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 5px 0;
}

/* Guest Links */
.steam-login-link {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.steam-login-link:hover {
    color: white;
    text-decoration: underline;
}

.separator {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 5px;
}

.nav-icon-btn {
    background: rgba(255,255,255,0.1);
    width: 30px; height: 30px;
    display: flex; justify-content: center; align-items: center;
    border-radius: 2px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.nav-icon-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* =========================
   FOOTER
========================= */
.ethoria-footer {
    background: var(--void-deep);
    border-top: 1px solid var(--glass-border);
    padding: 60px 0 30px;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-desc {
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 300px;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--arcane-amethyst);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================
   MISC COMPONENTS
========================= */
.story-signature {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    opacity: 0.7;
}

.modal-tag {
    color: var(--ethereal-teal);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: bold;
}

.modal-related {
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.related-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.related-card:hover {
    background: rgba(255,255,255,0.08);
}

.audit-log-inline {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
    font-family: monospace;
    line-height: 1.4;
    color: #888;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: var(--arcane-amethyst);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--amethyst-glow);
}

/* =========================
   INTERACTION STATES
========================= */
.fav-btn.favorited {
    color: #ff5555;
    border-color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
}

.add-btn.saved {
    color: #10b981;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* =========================
   CONTENT TYPOGRAPHY (GLOBAL)
========================= */
.entry-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1rem;
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content h2, 
.entry-content h3, 
.entry-content h4 {
    margin-top: 2em;
    margin-bottom: 0.8em;
    color: var(--text-primary);
}

.entry-content ul, 
.entry-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

.entry-content hr {
    border: 0;
    border-top: 1px solid var(--glass-border);
    margin: 3em 0;
}
