/* Custom Properties for Colors */
:root {
    --primary-color: #E74C3C; /* Red */
    --secondary-color: #F39C12; /* Orange */
    --background-dark: #2C3E50; /* Dark Blue-Grey */
    --text-light: #FFFFFF; /* White */
    --text-dark: #333333; /* Dark Grey for general text */
    --card-bg: #fdfdfd; /* Off-white for cards */
    --border-color: #ddd;
    --shadow-light: rgba(0,0,0,0.05);
    --shadow-medium: rgba(0,0,0,0.1);
    --shadow-heavy: rgba(0,0,0,0.3); /* For larger shadows */
}

/* Basic Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', Arial, sans-serif; /* Using Inter font */
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-dark); /* Dark background */
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--background-dark);
    color: var(--text-light);
    padding: 1rem 0;
    box-shadow: 0 2px 8px var(--shadow-medium);
    position: sticky; /* Sticky header */
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensure it stays on top */
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.main-header.scrolled {
    background: rgba(44, 62, 80, 0.95); /* Slightly transparent when scrolled */
    box-shadow: 0 4px 12px var(--shadow-heavy);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    color: var(--primary-color); /* Red site title */
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700; /* Bolder for Inter */
}

/* Menu Toggle for Mobile */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Navigation Links */
.nav-links {
    list-style: none;
    display: flex;
    position: relative; /* For dropdown positioning */
}

.nav-links li {
    margin-left: 30px; /* More space for navigation links */
    position: relative; /* For dropdown positioning */
}

.nav-links li.has-dropdown > a {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 5px 0;
    position: relative;
    white-space: nowrap; /* Prevent wrapping in menu items */
}

.nav-links a .dropdown-arrow {
    margin-left: 5px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

/* Underline effect for main nav links */
.nav-links > li > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color); /* Orange underline */
    transition: width 0.3s ease-out;
}

.nav-links > li > a:hover::after,
.nav-links > li > a:focus::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--secondary-color); /* Orange on hover */
}

/* Dropdown Menu Styles (Desktop) */
.dropdown-menu {
    list-style: none;
    display: none; /* Hidden by default for desktop hover */
    position: absolute;
    top: 100%; /* Position below the parent link */
    left: 0;
    background: var(--background-dark);
    box-shadow: 0 8px 16px var(--shadow-heavy);
    border-radius: 8px;
    min-width: 180px; /* Minimum width for dropdown */
    padding: 10px 0;
    z-index: 1010; /* Above header */
    transform: translateY(10px); /* Start slightly below for animation */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    pointer-events: none; /* Allow mouse to pass through when hidden */
}

.nav-links li.has-dropdown:hover .dropdown-menu,
.nav-links li.has-dropdown:focus-within .dropdown-menu { /* focus-within for keyboard access */
    display: block; /* Show on desktop hover/focus */
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Rotate arrow when dropdown is open */
.nav-links li.has-dropdown:hover > a .dropdown-arrow,
.nav-links li.has-dropdown:focus-within > a .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu li {
    margin: 0; /* Reset margin from parent nav-links li */
}

.dropdown-menu a {
    padding: 10px 20px; /* Padding for dropdown items */
    display: block;
    color: var(--text-light); /* White text in dropdown */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: var(--primary-color); /* Red background on hover */
    color: var(--text-light);
    text-decoration: none;
}
.dropdown-menu a.coming-soon:hover {
    background-color: transparent; /* No background color change for coming soon */
    color: #999; /* Maintain grey color */
    text-decoration: none;
}


/* Hero Section */
.hero-section {
    background: var(--primary-color); /* Red background for hero */
    color: var(--text-light);
    text-align: center;
    padding: 80px 0 100px 0; /* More vertical padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh; /* Make hero section taller */
}

.hero-section h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero-section p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    max-width: 700px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px; /* Pill-shaped buttons */
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent; /* For hover effect */
}

.btn-primary {
    background-color: var(--secondary-color); /* Orange button */
    color: var(--background-dark); /* Dark text on orange */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background-color: #E68A00; /* Slightly darker orange */
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-light);
    border-color: var(--text-light);
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-3px);
    border-color: var(--secondary-color); /* Orange border on hover */
    color: var(--secondary-color);
}

/* Tool Content Area (for SPA sections) */
.tool-content-area {
    background-color: var(--card-bg); /* Lighter background for content */
    border-top-left-radius: 20px; /* Rounded top corners for content area */
    border-top-right-radius: 20px;
    margin-top: -20px; /* Overlap with hero for smooth transition */
    position: relative;
    z-index: 1;
    min-height: 50vh; /* Ensure it has some height */
    padding-top: 40px; /* Padding for content inside */
}

/* Individual Tool Sections */
.tool-section {
    padding: 60px 0 80px 0; /* Padding for actual tool content */
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s ease-out; /* Fade in animation */
}

.tool-section.active {
    display: block; /* Show active tool section */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-section h2 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
}

.tool-section p {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}


/* Tools Overview Section (default home view) */
.tools-overview-section {
    /* This section is now a child of #tool-content */
    padding: 0; /* Padding handled by .tool-content-area and .tool-section */
    background-color: transparent; /* Its parent handles background */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}

.tools-overview-section h3 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 50px;
    color: var(--primary-color); /* Red heading */
    font-weight: 700;
}

.tool-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px; /* Slightly larger gap */
}

.category-card {
    background: var(--text-light); /* White background for cards */
    border: 1px solid var(--border-color);
    border-radius: 12px; /* More rounded corners */
    padding: 30px;
    box-shadow: 0 4px 15px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* Flex for content alignment */
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-8px); /* More pronounced lift on hover */
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.category-card h4 {
    color: var(--background-dark); /* Dark heading for cards */
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--primary-color); /* Red underline */
    padding-bottom: 15px;
    font-weight: 600;
}

.category-card ul {
    list-style: none;
    flex-grow: 1; /* Make list fill available space */
}

.category-card ul li {
    margin-bottom: 12px;
}

.category-card ul li a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.2s ease;
    display: block;
    padding: 5px 0;
    border-radius: 4px;
}

.category-card ul li a:hover {
    color: var(--primary-color); /* Red on link hover */
    padding-left: 10px; /* Slight indentation on hover */
    background-color: rgba(231,76,60,0.05); /* Very light red background */
}

.category-card ul li a.coming-soon {
    color: #999; /* Grey out coming soon links */
    cursor: not-allowed;
}
.category-card ul li a.coming-soon:hover {
    color: #999;
    padding-left: 0;
    background-color: transparent;
    text-decoration: none;
}


/* Footer */
.main-footer {
    background: var(--background-dark);
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
    margin-top: 0; /* No margin-top as section above has border-radius */
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.main-footer p {
    font-size: 1rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap; /* Allow links to wrap */
    justify-content: center;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary-color); /* Orange on footer link hover */
    text-decoration: underline;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        align-items: flex-start;
        position: relative; /* For menu-toggle positioning */
    }

    .site-title {
        margin-bottom: 15px;
    }

    .menu-toggle {
        display: block; /* Show on mobile */
        position: absolute;
        top: 15px;
        right: 20px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        /* Control display and height via JS and 'active' class */
        display: none; /* Hidden by default on mobile, JS will toggle this */
        text-align: center;
        margin-top: 10px;
        background: rgba(44, 62, 80, 0.95); /* Semi-transparent background for menu */
        border-radius: 8px;
        overflow: hidden; /* For smooth slide effect */
        max-height: 0; /* Animated height for menu open/close */
        transition: max-height 0.3s ease-in-out;
    }

    .nav-links.active {
        display: flex; /* Show when active */
        max-height: 500px; /* Increased height to accommodate dropdowns */
    }

    .nav-links li {
        margin: 0; /* Reset margin */
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: left; /* Align text left in mobile menu */
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        padding: 15px 20px; /* Larger clickable area with side padding */
        display: block;
    }
    .nav-links a::after {
        height: 2px;
        bottom: 0;
    }

    /* Mobile Dropdown Specifics */
    .nav-links li.has-dropdown .dropdown-menu {
        position: static; /* Stack dropdown items normally */
        display: none; /* Hidden by default, JS will toggle this */
        background: rgba(0,0,0,0.2); /* Slightly different background for sub-items */
        box-shadow: none;
        border-radius: 0;
        min-width: auto;
        padding: 0;
        transform: none;
        opacity: 1; /* Always visible when active */
        pointer-events: all;
        max-height: 0; /* Animated height for sub-menu open/close */
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    /* This class is added by JS when dropdown is open on mobile */
    .nav-links li.has-dropdown.dropdown-open > .dropdown-menu {
        display: block;
        max-height: 500px; /* Adjust as needed to reveal all sub-links */
    }

    .nav-links li.has-dropdown > a .dropdown-arrow {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }
    .nav-links li.has-dropdown.dropdown-open > a .dropdown-arrow {
        transform: translateY(-50%) rotate(180deg);
    }


    .dropdown-menu li {
        border-bottom: 1px solid rgba(255,255,255,0.05); /* Lighter border for sub-items */
    }
    .dropdown-menu li:last-child {
        border-bottom: none;
    }

    .hero-section {
        padding: 60px 20px 80px 20px;
        min-height: 50vh;
    }

    .hero-section h2 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%; /* Full width buttons on mobile */
        max-width: 300px; /* Cap width for very narrow screens */
    }

    .tools-overview-section h3 {
        font-size: 2.2rem;
    }

    .tool-categories {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }

    .category-card {
        padding: 20px;
    }

    .category-card h4 {
        font-size: 1.6rem;
    }

    .tool-section h2 {
        font-size: 2.2rem;
    }
}