/* Universal Styles */
* {
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

:root {
    /* Sith/Sci-Fi Red Color Palette */
    --color-primary: #ff3333; /* Dark Red/Sith for highlights and main actions */
    --color-secondary: #f0c000; /* Yellow/Gold for accents */
    --color-background: #0a0a0a; /* Deep, dark background */
    --color-text-light: #e0e0e0; /* Light text for contrast */
    --color-text-dim: #9e9e9e; /* Dim text for secondary info */
    --color-card-bg: rgba(25, 0, 0, 0.7); /* Dark red-tinged, transparent card background */
    --color-glass-border: rgba(255, 51, 51, 0.4); /* Red border for glass */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    color: var(--color-text-light);
    line-height: 1.7;
    background-color: var(--color-background);

    /* === LARGE WALLPAPER BACKGROUND for index.html (Star Destroyer) === */
    /* This applies to all pages unless overridden by .episode-page */
    background-image: url('MATS/ISD.webp');
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
}

/* Base Link Styling */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-secondary);
}

/* Main Content Wrapper */
main {
    max-width: 1200px; 
    margin: 0 auto;
    padding: 30px 20px;
    background-color: rgba(0, 0, 0, 0.85); 
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(255, 51, 51, 0.15); 
    position: relative; /* Ensures main is above the body's background */
    z-index: 2; /* Content layer */
}

/* Headings */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: var(--color-primary);
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.5); 
}

h1 {
    font-size: 2.5em;
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--color-primary);
    margin-top: 0;
}

h2 {
    font-size: 1.8em;
    border-left: 5px solid var(--color-secondary);
    padding-left: 10px;
    margin-top: 30px;
}

/* Navigation Bar */
header {
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 2px solid var(--color-primary);
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.3);
    position: sticky; 
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: center;
}

nav a {
    color: var(--color-text-light);
    font-weight: bold;
    text-transform: uppercase;
    padding: 15px 20px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

nav a:hover, nav a:focus {
    color: var(--color-primary);
    background-color: rgba(255, 51, 51, 0.15);
    border-bottom: 3px solid var(--color-primary);
}

/* Footer */
footer {
    background-color: rgba(0, 0, 0, 0.95);
    color: var(--color-text-dim);
    text-align: center;
    padding: 15px;
    font-size: 0.9em;
    border-top: 1px solid rgba(255, 51, 51, 0.3);
}

/* Home Page Sections */
.intro-section {
    display: flex;
    align-items: center;
    gap: 40px;
    margin: 40px 0;
    padding: 20px;
    border-left: 4px solid var(--color-secondary);
}

.intro-section img {
    flex-shrink: 0; 
    max-width: 300px;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 15px var(--color-primary);
    transition: transform 0.3s ease;
}

.intro-section img:hover {
    transform: scale(1.02);
}

.intro-section p {
    font-size: 1.1em;
}

/* Glass Panel Style */
.info-section, .product-card {
    padding: 20px;
    background-color: var(--color-card-bg); 
    border-radius: 8px;
    margin-top: 40px;
    
    /* GLASS EFFECT */
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    border: 1px solid var(--color-glass-border);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.1);
}

.info-section ul {
    list-style: none; 
    padding-left: 0;
}

.info-section li {
    background-color: rgba(255, 51, 51, 0.05); 
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid var(--color-primary);
    transition: background-color 0.2s ease;
}

.info-section li:hover {
    background-color: rgba(255, 51, 51, 0.15);
}

.social-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.2em;
    padding: 10px;
    border-top: 1px dashed var(--color-text-dim);
}

/* Images & Media */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

/* === Responsive Video Embedding (EPISODE Page) === */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 30px;
    border: 5px solid var(--color-primary);
    box-shadow: 0 0 30px var(--color-primary); 
}

.video-container iframe, .video-container video { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* === FIX: EPISODE Page Specific Styles (Blurred Background & Glass Panels) === */

/* 1. Reset the default body background for episode page */
body.episode-page {
    background-image: none;
    background-color: var(--color-background);
    position: relative;
    /* CRITICAL: Remove any filters that blur content */
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* 2. Create the Blurred Background Layer using a Pseudo-Element */
body.episode-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind everything */
    
    /* Apply the background image */
    background-image: url('MATS/ISD.webp');
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
    
    /* Apply Blur and Darkness ONLY to this layer */
    filter: blur(5px) brightness(0.6); 
    transform: scale(1.02); /* Prevents blur edge artifacts */
}

/* 3. The Page Wrapper holds all visible content above the blurred background */
.page-wrapper {
    min-height: 100vh;
    position: relative;
    z-index: 10; /* Above the blurred background */
}

/* 4. Make main transparent so background shows through */
.episode-page main {
    background-color: transparent; 
    box-shadow: none;
}

/* 5. Semi-transparent header */
.episode-page header {
    background-color: rgba(10, 10, 10, 0.85);
    position: relative;
    z-index: 100; /* Above everything */
}

/* 6. Glass panels for content sections */
.glass-panel {
    background-color: var(--color-card-bg); 
    padding: 30px;
    border: 1px solid var(--color-glass-border);
    border-radius: 15px;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.2);
    margin-top: 40px;
}

/* Trailer section specific styles */
.trailer-section {
    text-align: center;
}

.trailer-manager {
    color: var(--color-text-dim);
    font-style: italic;
    margin-bottom: 20px;
}

/* Competition info section */
.competition-info {
    text-align: center;
}

.tagline {
    color: var(--color-primary); 
    font-size: 1.4em;
    font-weight: bold;
    text-transform: uppercase;
    margin: 20px 0;
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.8);
}

.objective-box {
    text-align: left;
    margin: 20px 0;
}

.objective-box p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.simulation-note {
    font-style: italic;
    color: var(--color-secondary);
}

.event-details {
    margin-top: 20px;
    font-size: 1.1em;
    color: var(--color-text-light);
}

/* Sith-style buttons */
.sith-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-background);
    padding: 15px 35px; 
    margin-top: 25px;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid var(--color-primary);
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.sith-button:hover {
    background-color: var(--color-background); 
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 0 20px var(--color-primary);
}

.primary-button {
    font-size: 1.2em;
}

.call-to-action {
    font-size: 1.3em;
    padding: 18px 40px;
}

/* === MERCH Page Styles (Product Card) === */
.merch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-glass-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* GLASS EFFECT */
    backdrop-filter: blur(5px) saturate(120%);
    -webkit-backdrop-filter: blur(5px) saturate(120%);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 51, 51, 0.3);
}

.product-card img {
    border-radius: 4px;
    border: 1px solid var(--color-primary);
    max-height: 200px; 
    width: auto;
    margin: 0 auto 15px auto;
}

.product-card h3 {
    color: var(--color-secondary);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.order-button {
    background-color: var(--color-primary);
    color: var(--color-background);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    display: block; 
    margin-top: 15px;
    border: 2px solid var(--color-primary);
}

.order-button:hover {
    background-color: var(--color-background);
    color: var(--color-primary);
    box-shadow: 0 0 15px var(--color-primary);
}

/* === Mobile-First Media Query for smaller screens === */
@media (max-width: 800px) {
    .intro-section {
        flex-direction: column; 
        text-align: center;
    }
    .intro-section img {
        max-width: 80%;
    }
}
@media (max-width: 600px) {
    nav {
        flex-direction: column;
    }
    nav a {
        display: block; 
        border-bottom: 1px solid #333;
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    main {
        padding: 10px;
    }
}
