/*
Theme Name: The Last Light
Theme URI: https://example.com/the-last-light
Description: Modern, animated WordPress theme for The Last Light horror game. Dark theme with smooth animations, cinematic design, and conversion-optimized layout.
Version: 1.0.0
Author: The Last Light Team
Author URI: https://example.com
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-last-light
Tags: dark, gaming, horror, animated, modern, responsive
*/

/* ============================================
   THE LAST LIGHT - WordPress Theme
   Modern, Animated, Conversion-Optimized
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #050508;
    --bg-secondary: #0a0a12;
    --bg-card: #111118;
    --bg-card-hover: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --accent-red: #ff3333;
    --accent-red-glow: rgba(255, 51, 51, 0.4);
    --accent-gold: #ffaa00;
    --accent-gold-glow: rgba(255, 170, 0, 0.3);
    --accent-green: #00ff44;
    --accent-blue: #4488ff;
    --border-color: #222233;
    --border-glow: rgba(255, 51, 51, 0.2);
    --font-heading: 'Orbitron', 'Courier New', monospace;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --shadow-red: 0 0 20px rgba(255, 51, 51, 0.3);
    --shadow-gold: 0 0 20px rgba(255, 170, 0, 0.3);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-red);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 2px;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 3vw, 2rem); }
h4 { font-size: clamp(1rem, 2vw, 1.5rem); }

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

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

/* ---- Navigation ---- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-normal);
}

.site-header.scrolled {
    background: rgba(5, 5, 8, 0.95);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-red);
    text-shadow: 0 0 20px var(--accent-red-glow);
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo .logo-icon {
    font-size: 1.8rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 10px var(--accent-red-glow); }
    50% { text-shadow: 0 0 30px var(--accent-red-glow), 0 0 60px var(--accent-red-glow); }
}

.main-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-fast);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width var(--transition-normal);
    box-shadow: 0 0 10px var(--accent-red-glow);
}

.main-nav a:hover {
    color: var(--text-primary);
}

.main-nav a:hover::after {
    width: 100%;
}

.nav-cta {
    padding: 10px 24px;
    background: var(--accent-red);
    color: #fff !important;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    box-shadow: 0 0 20px var(--accent-red-glow);
}

.nav-cta:hover {
    background: #ff5555;
    box-shadow: 0 0 40px var(--accent-red-glow);
    transform: translateY(-2px);
}

.nav-cta::after {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* ---- Hero Section ---- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-primary);
}

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

.hero-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.hero-bg .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(5, 5, 8, 0.3) 0%,
        rgba(5, 5, 8, 0.7) 50%,
        rgba(5, 5, 8, 1) 100%
    );
}

.hero-bg .particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-red);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s ease-in-out infinite;
}

@keyframes float-particle {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-100vh) scale(1.5); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 20px;
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--accent-red);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 30px;
    animation: fadeInDown 1s ease 0.3s both;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease 0.5s both;
}

.hero-title .highlight {
    color: var(--accent-red);
    text-shadow: 0 0 40px var(--accent-red-glow);
    display: block;
}

.hero-title .subtitle {
    font-size: 0.4em;
    color: var(--text-secondary);
    letter-spacing: 6px;
    display: block;
    margin-top: 10px;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    animation: fadeInUp 1s ease 0.7s both;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.9s both;
}

.btn-primary {
    padding: 16px 40px;
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 30px var(--accent-red-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: #ff5555;
    box-shadow: 0 0 50px var(--accent-red-glow);
    transform: translateY(-3px);
}

.btn-secondary {
    padding: 16px 40px;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 30px var(--accent-gold-glow);
    transform: translateY(-3px);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    animation: bounce 2s ease infinite;
}

.hero-scroll-indicator span {
    display: block;
    width: 2px;
    height: 30px;
    background: linear-gradient(180deg, var(--accent-red), transparent);
    margin: 0 auto;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ---- Section Styles ---- */
.section {
    padding: 100px 0;
    position: relative;
}

.section-dark {
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    margin-bottom: 15px;
}

.section-title .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-title .accent-line {
    width: 60px;
    height: 3px;
    background: var(--accent-red);
    margin: 20px auto 0;
    box-shadow: 0 0 15px var(--accent-red-glow);
}

/* ---- Reveal Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Gameplay Video Section ---- */
.gameplay-section {
    position: relative;
    overflow: hidden;
}

.video-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-red-glow);
    border: 1px solid var(--border-color);
}

.video-container video {
    width: 100%;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: opacity var(--transition-normal);
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 51, 51, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    transition: all var(--transition-fast);
    box-shadow: 0 0 40px var(--accent-red-glow);
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 60px var(--accent-red-glow);
}

/* ---- Features Grid ---- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px 30px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px var(--accent-red-glow);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ---- Marketplace Section ---- */
.marketplace-section {
    background: var(--bg-secondary);
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.market-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.market-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-gold-glow);
}

.market-item-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #1a1a2e, #0a0a12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.market-item-image img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.market-item:hover .market-item-image img {
    transform: scale(1.1) rotate(5deg);
}

.market-item-image .item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
}

.market-item-info {
    padding: 20px;
}

.market-item-info h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.market-item-info .item-type {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.market-item-info .item-price {
    color: var(--accent-gold);
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.market-item-info .item-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 8px;
    line-height: 1.5;
}

/* ---- Stats Section ---- */
.stats-section {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

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

.stat-card {
    text-align: center;
    padding: 30px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent-red);
    text-shadow: 0 0 30px var(--accent-red-glow);
    line-height: 1;
    margin-bottom: 10px;
}

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

/* ---- Testimonials ---- */
.testimonials-section {
    background: var(--bg-secondary);
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 4rem;
    color: var(--accent-red);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.testimonial-name {
    font-weight: 700;
    color: var(--text-primary);
}

.testimonial-role {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- CTA Section ---- */
.cta-section {
    background: linear-gradient(135deg, #1a0000, #0a0a12, #001a00);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, var(--accent-red-glow) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, var(--accent-gold-glow) 0%, transparent 50%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    margin-bottom: 20px;
}

.cta-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
}

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

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

.footer-column a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 5px 0;
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer-column a:hover {
    color: var(--accent-red);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px var(--accent-red-glow);
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.text-red { color: var(--accent-red); }
.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .hero-cta { flex-direction: column; align-items: center; }
    .btn-primary, .btn-secondary { width: 100%; max-width: 300px; }
    .features-grid { grid-template-columns: 1fr; }
    .marketplace-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.5rem; }
}

/* ---- WordPress Core ---- */
.alignwide { max-width: 1400px; }
.alignfull { max-width: 100%; }
.wp-block-image img { border-radius: 4px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-red); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #ff5555; }

/* ---- Selection ---- */
::selection { background: var(--accent-red); color: #fff; }

/* ---- Loading Animation ---- */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    position: absolute;
    bottom: 40%;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-red);
    letter-spacing: 4px;
    animation: pulse-text 1.5s ease infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
