/* --- Base Styles & Variables --- */
:root {
    --bg-dark: #1a1a1a; /* Dark grey */
    --bg-darker: #111;
    --accent-yellow: #ffd700; /* Gold/Yellow */
    --text-light: #f4f4f4;
    --text-dark: #333;
    --text-muted: #aaa;
    --border-color: #444;

    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Clean sans-serif */
    --font-headings: 'Segoe UI Bold', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --transition-speed: 0.3s;
    --animation-delay: 0.15s;
}

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

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

body.no-scroll { /* Added for mobile menu overflow control */
    overflow: hidden;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-headings);
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--accent-yellow);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.5rem; color: var(--text-light); }
h4 { font-size: 1.1rem; color: var(--accent-yellow); }

p {
    margin-bottom: 1rem;
}
p.section-intro {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

a {
    color: var(--accent-yellow);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover, a:focus {
    color: #e6c300;
}

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

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

/* --- Header --- */
.site-header {
    background-color: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(5px);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color var(--transition-speed) ease;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-yellow);
}

/* DESKTOP MAIN NAVIGATION (Default State) */
.main-nav {
    display: block; /* Visible by default on desktop */
}

.main-nav .nav-links-wrapper {
    display: block; /* Visible by default on desktop */
    position: static; /* No absolute positioning on desktop */
    transform: none; /* No transforms on desktop */
    opacity: 1; /* Fully opaque on desktop */
    padding: 0; /* Reset mobile padding */
}

.main-nav ul {
    display: flex; /* Horizontal on desktop */
    flex-direction: row; /* Ensure horizontal display */
    width: auto; /* Allow content to dictate width */
    align-items: center;
}

.main-nav li {
    margin-left: 1.5rem;
    position: relative;
    margin-top: 0; /* Reset mobile vertical margin */
    width: auto; /* Reset mobile full width */
    border-bottom: none; /* Reset mobile border */
}

.main-nav a {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 0.1rem;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background-color: var(--accent-yellow);
    transition: left var(--transition-speed) ease-out;
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    left: 0;
}

.main-nav a.active {
    color: var(--accent-yellow);
}

.main-nav a.active::after {
    left: 0;
}


/* --- Dropdown Styles (Desktop) --- */
.dropdown-content {
    /* Initially hidden for desktop hover, shown on hover */
    display: none;
    position: absolute;
    background-color: var(--bg-dark);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 1;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    padding-top: 10px;
    margin-top: -5px;
}

.dropdown-content a {
    color: var(--text-light);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    white-space: nowrap;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.dropdown-content a:hover {
    background-color: var(--bg-darker);
    color: var(--accent-yellow);
}

/* This rule is for DESKTOP hover behavior ONLY. We'll handle mobile differently. */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content,
    .dropdown-content:hover {
        display: block; /* Explicitly show for hover */
        opacity: 1;
        visibility: visible;
    }
}


/* --- Dropdown Button (dropbtn) styling --- */
.dropbtn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.5rem 0.1rem;
    position: relative;
    text-decoration: none;
    border: none;
    background: none;
    color: var(--text-light);
    font-weight: 500;
}
.dropbtn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background-color: var(--accent-yellow);
    transition: left var(--transition-speed) ease-out;
}
.dropbtn:hover::after,
.dropbtn:focus::after {
    left: 0;
}


.arrow-down {
    border: solid var(--text-light);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform var(--transition-speed) ease;
    vertical-align: middle;
}

.dropdown:hover .arrow-down {
    transform: rotate(225deg);
}

/* Rotate arrow on mobile when dropdown is active */
.dropdown.active-dropdown .arrow-down {
    transform: rotate(225deg);
}


/* --- Hero, Content, Footer, Animations remain unchanged from previous correct versions --- */
.hero-section {
    min-height: 80vh;
    padding-top: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(17, 17, 17, 0.7), rgba(26, 26, 26, 0.9)), url('placeholder-bg.jpg') no-repeat center center/cover;
    background-color: var(--bg-darker);
    position: relative;
}

.hero-section h1 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}
.hero-section h1::first-line {
    color: var(--accent-yellow);
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.content-section {
    padding: 4rem 0;
}

.dark-section {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.content-section h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.content-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-yellow);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.services-list {
    max-width: 600px;
    margin: 2rem auto 0 auto;
}
.services-list li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}
.services-list .icon {
    margin-right: 0.7rem;
    color: var(--accent-yellow);
    width: 25px;
    text-align: center;
    flex-shrink: 0;
}

.webapp-highlight {
    background-color: var(--bg-dark);
    padding: 2rem;
    border-radius: 8px;
    max-width: 700px;
    margin: 2rem auto 0 auto;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.webapp-logo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.webapp-info {
    text-align: left;
    flex-grow: 1;
}

.webapp-info h3 {
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}
.webapp-info p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.webapp-info .cta-button {
    margin-top: 1rem;
    margin-right: 1rem;
}
.learn-more-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.learn-more-link:hover {
    color: var(--accent-yellow);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    background-color: var(--bg-darker);
    padding: 1.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.1);
}
.feature-item .icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: var(--accent-yellow);
    display: inline-block;
    width: 25px;
    text-align: center;
}
.feature-item h4 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
.feature-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-yellow);
    color: var(--bg-dark);
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover, .cta-button:focus {
    background-color: #e6c300;
    color: var(--bg-darker);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.2);
}

.site-footer {
    background-color: var(--bg-darker);
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.animate-on-load {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}
.animate-on-load.delay-1 { animation-delay: var(--animation-delay); }
.animate-on-load.delay-2 { animation-delay: calc(var(--animation-delay) * 2); }


/* --- Mobile Navigation Specific Styles (Hamburger Menu) --- */
.menu-toggle {
    display: none; /* Hidden on desktop, shown by media query */
    position: relative; /* Crucial for positioning the hamburger bars */
    flex-direction: column;
    justify-content: space-around;
    width: 30px; /* Fixed width */
    height: 25px; /* Fixed height */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle .hamburger {
    display: block; /* The middle bar */
    width: 100%;
    height: 3px;
    background: var(--accent-yellow);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute; /* Allows precise top positioning */
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* Pseudo-elements for top and bottom bars */
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--accent-yellow);
    border-radius: 2px;
    transition: all 0.3s ease;
    left: 0;
}

.menu-toggle .hamburger::before {
    top: -8px; /* Position 8px above the middle bar */
}

.menu-toggle .hamburger::after {
    top: 8px; /* Position 8px below the middle bar */
}

/* Open state for hamburger icon */
.menu-toggle.open .hamburger {
    background-color: transparent; /* Hide middle bar when open */
}

.menu-toggle.open .hamburger::before {
    transform: rotate(45deg); /* Rotate top bar */
    top: 0; /* Move to center */
}

.menu-toggle.open .hamburger::after {
    transform: rotate(-45deg); /* Rotate bottom bar */
    top: 0; /* Move to center */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- MOBILE SPECIFIC STYLES (Overrides Desktop Defaults) --- */
@media (max-width: 768px) {
    html { font-size: 15px; }

    .site-header .container {
        flex-direction: row;
        justify-content: space-between;
    }

    /* Show hamburger on mobile */
    .menu-toggle {
        display: flex;
    }

    /* Hide desktop nav by default on mobile */
    .main-nav {
        display: none; /* Hide the whole nav by default */
        position: fixed; /* Changed to fixed to cover the whole screen */
        top: 65px; /* Adjust based on your header height */
        left: 0;
        width: 100%;
        height: calc(100vh - 65px); /* Full viewport height minus header */
        background-color: var(--bg-darker);
        flex-direction: column;
        align-items: center;
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
        padding: 0;
        overflow-y: auto; /* Allow scrolling if menu is long */
    }

    /* Show main nav when 'open' class is applied by JS */
    .main-nav.open {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }

    .main-nav .nav-links-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 1rem 0;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .main-nav li {
        margin: 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        padding: 0.8rem 1rem;
        width: 100%;
        display: block;
    }
    
    .dropbtn {
        width: 100%;
        justify-content: center; /* Center the text and arrow */
    }

    /* --- FIX: MOBILE DROPDOWN STYLES --- */
    .dropdown-content {
        /* 1. KEY FIX: Set display to block to allow animations */
        display: block; 
        
        /* Reset desktop styles */
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        opacity: 1; /* Opacity will be controlled by max-height */
        visibility: visible; /* Visibility will be controlled by max-height */
        width: 100%;
        
        /* Use a subtle background and hide with max-height for animation */
        background-color: rgba(0,0,0,0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease-out;
        padding: 0;
        margin: 0;
    }
    
    /* Show mobile dropdown content when 'active-dropdown' class is applied by JS */
    .dropdown.active-dropdown .dropdown-content {
        max-height: 200px; /* Animate to this height */
    }

    .nav-links-wrapper .dropdown-content a {
        padding: 0.6rem 2rem; /* Indent sub-items */
        font-size: 0.9em;
        color: var(--text-muted);
        text-align: center;
    }
    
    .nav-links-wrapper .dropdown-content a:hover {
        color: var(--accent-yellow);
        background-color: transparent;
    }

    /* 2. KEY FIX: Remove desktop underline effects on mobile */
    .main-nav a::after {
        display: none;
    }

    /* Hero, Content, Footer, Animations remain unchanged */
    .hero-section {
        min-height: 60vh;
        padding-top: 150px;
    }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }

    .content-section { padding: 3rem 0; }

    .webapp-highlight {
        flex-direction: column;
        text-align: center;
        max-width: 400px;
    }
       .webapp-info {
        text-align: center;
    }
    .webapp-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }

    .hero-section h1 { font-size: 2rem; }
    .hero-section p { font-size: 1rem; }

    .cta-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
       .webapp-highlight {
        padding: 1.5rem;
    }
}