:root {
    --primary: #4a148c;
    /* Dark Purple */
    --accent: #ff3333;
    /* Red */
    --bg-dark: #0a0a0a;
    --bg-card: #1f1f1f;
    --text-main: #e0e0e0;
    --font-head: 'Orbitron', 'Segoe UI', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Header Split Layout */
.main-header {
    background: linear-gradient(to bottom, #000 0%, #1a0b2e 100%);
    padding: 1rem 5%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Left - Center - Right */
    align-items: center;
    border-bottom: 2px solid var(--primary);
    position: relative;
    z-index: 500;
}

.nav-left {
    justify-self: end;
    /* Push towards center logo */
    padding-right: 2rem;
}

.nav-right {
    justify-self: start;
    /* Push towards center logo */
    padding-left: 2rem;
}

.logo-center {
    justify-self: center;
    text-align: center;
}

.logo-center h1 {
    font-family: var(--font-head);
    color: #fff;
    margin: 0;
    font-size: 2.5rem;
    text-shadow: 0 0 10px var(--primary);
}

.logo-center p {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--accent);
}

/* Common Nav Styles */
ul.top-nav {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.top-nav li {
    margin: 0 1.5rem;
    position: relative;
}

.top-nav a {
    text-decoration: none;
    color: #aaa;
    font-weight: bold;
    transition: color 0.3s;
    font-family: var(--font-head);
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Dropdown fix for split nav */
.top-nav .dropdown {
    left: 0;
}


.top-nav a {
    text-decoration: none;
    color: #aaa;
    font-weight: bold;
    transition: color 0.3s;
    font-family: var(--font-head);
    font-size: 0.9rem;
}

.top-nav a:hover {
    color: var(--accent);
}

.top-nav .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-dark);
    border: 1px solid var(--primary);
    min-width: 150px;
    padding: 0;
    z-index: 100;
}

.top-nav .has-dropdown:hover .dropdown {
    display: block;
}

.top-nav .dropdown li {
    margin: 0;
}

.top-nav .dropdown a {
    display: block;
    padding: 10px;
}

/* Hero Section */
.hero-section {
    position: relative;
    text-align: center;
    padding: 4rem 0;
    background: radial-gradient(circle at center, #2e003e 0%, #000 70%);
    min-height: 300px;
    overflow: hidden;
    width: 100%;
    /* Force width */
    max-width: 100vw;
    /* Ensure no overflow issues */
}

.hero-title {
    font-family: var(--font-head);
    font-size: 5rem;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 20px var(--primary);
}

.hero-subtitle {
    color: #aaa;
    letter-spacing: 3px;
    margin-top: 10px;
}

.galaxy-bg {
    margin-top: 2rem;
}

.cta-btn {
    background: transparent;
    border: 2px solid #00d4ff;
    /* Cyan accent for contrast */
    color: #00d4ff;
    padding: 10px 30px;
    font-family: var(--font-head);
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.cta-btn:hover {
    background: #00d4ff;
    color: #000;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.6);
}

/* Cards Section - Middle (Modded for Carousel) */
.cards-section {
    background: #000;
    padding: 4rem 2rem;
    border-top: 1px solid #333;
    position: relative;
}

/* Carousel Styles */
.carousel-container {
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    /* Show 1 at a time, or change to 25% or 33% based on desired look. User asked for 4 page scrolling. Let's do 1 big one or maybe 3. "4 page scrolling carousel" implies 4 items to scroll through. I'll make them take 100% width for a clear slide effect on mobile, maybe 33% on desktop. Let's start with 100% for drama. */
    box-sizing: border-box;
    padding: 10px;
    display: flex;
    justify-content: center;
}

@media(min-width: 768px) {
    .cards-section .carousel-slide {
        min-width: 33.333%;
        /* 3 items visible on desktop for cards only */
    }
}

.feature-card {
    background: #111;
    padding: 2rem;
    text-align: center;
    border-top: 3px solid var(--primary);
    transition: transform 0.3s;
    width: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
}

.card-icon {
    font-size: 3rem;
    color: #00d4ff;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-family: var(--font-head);
    color: #fff;
}

.feature-card p {
    color: #777;
    font-size: 0.9rem;
    line-height: 1.6;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid var(--primary);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    padding: 10px;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}


/* Widget Area - Bottom Black 3Dish */
.widget-area {
    background: #050505;
    padding: 2rem;
    position: relative;
    border-top: 5px solid var(--accent);
    min-height: 400px;
    perspective: 1000px;
    /* For 3D feel */
}

.config-cog {
    position: absolute;
    top: -20px;
    right: 20px;
    background: var(--accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 10px red;
    z-index: 50;
    transition: transform 0.5s;
}

.config-cog:hover {
    transform: rotate(180deg);
}

.config-cog i {
    color: white;
}

.hero-full-slider {
    position: relative;
    width: 100vw;
    /* Full Viewport Width */
    max-width: none !important;
    /* Override the 1200px limit */
    overflow: hidden !important;
    /* Masking */
    padding: 0 !important;
    /* Remove generic carousel padding */
    margin: 0;
    display: block;
    /* Ensure it's a block container */
    left: 50%;
    transform: translateX(-50%);
    /* Center if inside a parent container */
}

/* Widget Modal */
.widget-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #222;
    padding: 2rem;
    border: 1px solid var(--primary);
    border-radius: 10px;
    min-width: 300px;
    color: white;
}

.widget-option {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #444;
}

.widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
}

.widget-box {
    background: linear-gradient(135deg, #1a1a1a, #000);
    border: 1px solid #333;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transform: rotateX(5deg);
    /* Slight 3D tilt */
    transition: transform 0.3s;
}

.widget-box:hover {
    transform: rotateX(0deg) scale(1.02);
    border-color: var(--primary);
}

.widget-title {
    color: var(--primary);
    font-family: var(--font-head);
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.widget-content {
    color: #ddd;
}

/* Specific Widget Styles */
.clock-display {
    font-size: 2rem;
    font-family: monospace;
    color: #00d4ff;
    text-align: center;
}

.weather-display {
    text-align: center;
}

.weather-temp {
    font-size: 2.5rem;
    color: #ffeb3b;
}

.moon-icon {
    font-size: 3rem;
    color: #e0e0e0;
    text-align: center;
    display: block;
}

.holiday-alert {
    color: var(--accent);
    font-weight: bold;
}

footer {
    background: #000;
    text-align: center;
    padding: 2rem;
    color: #444;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* --- HERO CAROUSEL SETTINGS (RECONSTRUCTED) --- */
.hero-carousel {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.hero-slide-content {
    text-align: center;
    color: #e0e0e0;
    padding: 20px;
    z-index: 2;
    position: relative;
}

.hero-slide-content h3 {
    color: var(--primary);
    font-family: var(--font-head);
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

/* Arrows for Hero */
.hero-carousel .carousel-btn {
    background: transparent;
    border: none;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.hero-carousel .carousel-btn:hover {
    color: var(--primary);
}

.hero-carousel .prev-btn {
    left: 20px;
}

.hero-carousel .next-btn {
    right: 20px;
}

/* Ensure Slides are 100% width */
.hero-carousel .carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cards Container Grid Restore */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- MOBILE RESPONSIVENESS FIXES (ADDED) --- */

@media (max-width: 900px) {

    /* Header Re-layout for Tablet/Mobile */
    .main-header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "nav-left"
            "nav-right";
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }

    .logo-center {
        grid-area: logo;
        margin-bottom: 1rem;
    }

    .nav-left {
        grid-area: nav-left;
        justify-self: center;
        padding-right: 0;
        margin-bottom: 0.5rem;
    }

    .nav-right {
        grid-area: nav-right;
        justify-self: center;
        padding-left: 0;
    }

    .top-nav {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {

    /* Hero Text Sizing */
    .hero-slide-content h2.hero-title,
    .hero-title {
        font-size: 2.5rem !important;
        white-space: normal !important;
        margin-bottom: 10px !important;
        line-height: 1.2;
    }

    .hero-slide-content p.hero-subtitle,
    .hero-subtitle {
        font-size: 0.9rem !important;
        padding: 0 10px;
        white-space: normal !important;
    }

    /* Hero Carousel Spacing */
    .hero-carousel,
    .hero-full-slider {
        padding: 0 0px !important;
    }

    .hero-carousel .carousel-slide,
    .hero-full-slider .carousel-slide {
        padding: 0 10px !important;
    }

    /* Adjust Arrows */
    .hero-carousel .carousel-btn,
    .hero-full-slider .carousel-btn {
        font-size: 2rem !important;
        padding: 5px !important;
        opacity: 0.5;
    }

    .hero-carousel .prev-btn,
    .hero-full-slider .prev-btn {
        left: 0 !important;
    }

    .hero-carousel .next-btn,
    .hero-full-slider .next-btn {
        right: 0 !important;
    }

    /* Cards to 1 Column */
    .cards-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .feature-card {
        width: 100% !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .logo-center h1 {
        font-size: 1.8rem;
    }

    .top-nav a {
        font-size: 0.8rem;
    }

    .hero-slide-content h2.hero-title {
        font-size: 2rem !important;
    }
}
