/**
 * ============================================================================
 * RELATANDO.COM - MODULE SPOTLIGHT & COMPLIANCE
 * ----------------------------------------------------------------------------
 * 1. Spotlight Cards & Evervault Arcane Cards (Bestiario & Enciclopedia del Terror)
 *    Palette: Fuegos Fatuos (#00e58b / rgba(0, 255, 136, 0.16)) & Oro Antiguo (#d4af37)
 * 2. Complianz GDPR Cookie Banner 'Transition Panel' (CLS = 0, Smoked Glass Noir)
 *    Ribetes en oro antiguo #d4af37, toggles en #00e58b, botón aceptar en verde esmeralda y oro
 * ============================================================================
 */

/* ============================================================================
   1. ROOT VARIABLES & DESIGN TOKENS (FUEGOS FATUOS & ORO ANTIGUO)
   ============================================================================ */
:root {
    /* Spotlight & Evervault Lighting - Fuegos Fatuos & Oro Antiguo */
    --spotlight-beam-size: 520px;
    --spotlight-color-fuego-fatuo: rgba(0, 255, 136, 0.16);
    --spotlight-color-fuego-fatuo-glow: rgba(0, 229, 139, 0.35);
    --spotlight-color-fuego-fatuo-vivid: #00e58b;
    --spotlight-color-fuego-fatuo-emerald: rgba(0, 255, 136, 0.85);
    --spotlight-color-gold: #d4af37;
    --spotlight-color-gold-halo: rgba(212, 175, 55, 0.12);
    --spotlight-color-gold-pale: rgba(245, 230, 163, 0.15);
    --spotlight-color-ambient: rgba(255, 255, 255, 0.03);
    
    /* Card Geometry & Coordinates */
    --mouse-x: 50%;
    --mouse-y: 50%;
    --spotlight-opacity: 0;
    --card-tilt-x: 0deg;
    --card-tilt-y: 0deg;

    /* Complianz Smoked Glass Transition Panel */
    --cp-panel-bg: rgba(9, 11, 15, 0.94);
    --cp-panel-border: #d4af37;
    --cp-panel-border-subtle: rgba(212, 175, 55, 0.35);
    --cp-panel-border-glow: rgba(212, 175, 55, 0.3);
    --cp-panel-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(212, 175, 55, 0.18), 0 0 25px rgba(0, 229, 139, 0.12);
    --cp-text-primary: #f2e9e4;
    --cp-text-muted: #a39b94;
    --cp-gold: #d4af37;
    --cp-gold-light: #fbeea8;
    --cp-fuego-fatuo: #00e58b;
    --cp-fuego-fatuo-glow: rgba(0, 229, 139, 0.55);
    --cp-surface-inner: rgba(16, 18, 24, 0.7);
    --cp-surface-hover: rgba(24, 28, 36, 0.88);
}

/* ============================================================================
   2. SPOTLIGHT CARDS (ENCICLOPEDIA DEL TERROR & BESTIARIO)
   ============================================================================ */

/* Base Container for Spotlight-enabled cards */
.relatando-spotlight-card,
.spotlight-card,
.bestiario-card,
.encyclopedia-card,
.grimorio-card,
.post-card[data-spotlight="true"] {
    position: relative;
    border-radius: 12px;
    background-color: #0b0c0f;
    border: 1px solid rgba(212, 175, 55, 0.15);
    overflow: hidden;
    isolation: isolate;
    padding: 28px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
    transform: perspective(1000px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translate3d(0, 0, 0);
    will-change: transform, border-color, box-shadow;
    contain: layout style;
}

/* Atmospheric subtle idle state */
.relatando-spotlight-card:hover,
.spotlight-card:hover,
.bestiario-card:hover,
.encyclopedia-card:hover,
.grimorio-card:hover,
.post-card[data-spotlight="true"]:hover {
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.9),
                0 0 30px -5px rgba(212, 175, 55, 0.22),
                0 0 20px -8px rgba(0, 255, 136, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
}

/* Dynamic Flashlight Beam (Lantern Glow: Verde Fuegos Fatuos suave + Halo Oro Antiguo) */
.relatando-spotlight-card::before,
.spotlight-card::before,
.bestiario-card::before,
.encyclopedia-card::before,
.grimorio-card::before,
.post-card[data-spotlight="true"]::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: var(--spotlight-opacity, 0);
    transition: opacity 0.35s ease;
    background: radial-gradient(
        var(--spotlight-beam-size) circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 255, 136, 0.16) 0%,
        rgba(212, 175, 55, 0.12) 28%,
        rgba(255, 255, 255, 0.02) 50%,
        transparent 70%
    );
    mix-blend-mode: screen;
}

/* Illuminated Border Halo (Dynamic Edge Light in Antique Gold #d4af37) */
.relatando-spotlight-card::after,
.spotlight-card::after,
.bestiario-card::after,
.encyclopedia-card::after,
.grimorio-card::after,
.post-card[data-spotlight="true"]::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px; /* Border thickness */
    background: radial-gradient(
        320px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        #d4af37 0%,
        rgba(212, 175, 55, 0.75) 25%,
        rgba(212, 175, 55, 0.35) 50%,
        rgba(0, 255, 136, 0.15) 70%,
        transparent 85%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: var(--spotlight-opacity, 0);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

/* Gothic Damask / Alchemical Texture Revealed under the Light */
.spotlight-gothic-texture {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.22;
    background-image: 
        radial-gradient(circle at center, rgba(212, 175, 55, 0.18) 1px, transparent 1px),
        radial-gradient(circle at center, rgba(0, 255, 136, 0.1) 1.5px, transparent 1.5px),
        repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.03) 0, rgba(212, 175, 55, 0.03) 1px, transparent 0, transparent 12px);
    background-size: 24px 24px, 48px 48px, 24px 24px;
    background-position: 0 0, 12px 12px, 0 0;
    mask-image: radial-gradient(
        var(--spotlight-beam-size) circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        black 0%,
        rgba(0, 0, 0, 0.6) 40%,
        transparent 75%
    );
    -webkit-mask-image: radial-gradient(
        var(--spotlight-beam-size) circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        black 0%,
        rgba(0, 0, 0, 0.6) 40%,
        transparent 75%
    );
    transition: opacity 0.4s ease;
}

/* Card Content Floating above Lighting */
.spotlight-card-content {
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

/* Bestiary & Encyclopedia Specific Typography & Badges */
.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--cp-gold);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    width: fit-content;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.spotlight-badge.badge-bestiario {
    color: #00e58b;
    background: rgba(0, 229, 139, 0.12);
    border-color: rgba(0, 229, 139, 0.35);
    text-shadow: 0 0 10px rgba(0, 229, 139, 0.4);
}

.spotlight-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    color: #ffffff;
    margin: 0 0 10px 0;
    line-height: 1.35;
    transition: color 0.3s ease;
}

.relatando-spotlight-card:hover .spotlight-card-title {
    color: #fff8eb;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.spotlight-card-excerpt {
    font-size: 0.88rem;
    color: #9a9590;
    line-height: 1.6;
    margin-bottom: 18px;
}

.spotlight-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #7a7570;
}

.spotlight-card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cp-gold);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.relatando-spotlight-card:hover .spotlight-card-action {
    color: #ffe082;
    transform: translateX(4px);
}

/* ============================================================================
   3. EVERVAULT CARDS (ENCRYPTED GRIMOIRE / FUEGO FATUO RUNE MATRIX)
   ============================================================================ */

.evervault-card {
    position: relative;
    border-radius: 14px;
    background: #090a0d;
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 8px;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    contain: layout style;
}

.evervault-card:hover {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.95),
                0 0 35px rgba(0, 255, 136, 0.25),
                0 0 20px rgba(212, 175, 55, 0.2);
}

/* The Arcane Canvas Layer where runic code cascades */
.evervault-matrix-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    background: #040507;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, 0.12);
}

/* Random Glyph Mask Streaming in the dark - Fuego Fatuo Verde Esmeralda */
.evervault-matrix-text {
    position: absolute;
    inset: -20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 14px;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.9),
                 0 0 18px rgba(0, 229, 139, 0.65),
                 0 0 4px #d4af37;
    word-break: break-all;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    mask-image: radial-gradient(
        220px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        black 20%,
        rgba(0, 0, 0, 0.6) 50%,
        transparent 80%
    );
    -webkit-mask-image: radial-gradient(
        220px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        black 20%,
        rgba(0, 0, 0, 0.6) 50%,
        transparent 80%
    );
}

.evervault-card:hover .evervault-matrix-text {
    opacity: 1;
}

/* Center Emblem / Beast Sigil in the Evervault Card */
.evervault-sigil-container {
    position: relative;
    z-index: 2;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.85),
                inset 0 0 15px rgba(0, 229, 139, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #f2e9e4;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.evervault-card:hover .evervault-sigil-container {
    transform: scale(1.08);
    border-color: #d4af37;
    box-shadow: 0 0 32px rgba(0, 255, 136, 0.5),
                inset 0 0 20px rgba(212, 175, 55, 0.4);
}

/* Description body below the matrix */
.evervault-body {
    padding: 18px 12px 10px 12px;
}

.evervault-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.evervault-classification {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #00e58b;
    margin-bottom: 8px;
    display: block;
    text-shadow: 0 0 8px rgba(0, 229, 139, 0.35);
}

}

/* Touch device ambient pulsing breathing for cards without pointer hover */
@media (hover: none) {
    .relatando-spotlight-card::before,
    .spotlight-card::before,
    .bestiario-card::before,
    .encyclopedia-card::before {
        opacity: 0.6;
        animation: spotlightMobileBreathe 6s ease-in-out infinite alternate;
    }

    @keyframes spotlightMobileBreathe {
        0% {
            background-size: 80% 80%;
            opacity: 0.3;
        }
        100% {
            background-size: 130% 130%;
            opacity: 0.65;
        }
    }
}

/* Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .relatando-spotlight-card,
    .spotlight-card {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
