/* css/style.css */

/* --- Google Font & Global Resets --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Utility & Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--card-bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.logo-area .title {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.logo-area .subtitle {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.search-bar form {
    display: flex;
}

.search-bar input[type="search"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px 0 0 5px;
    min-width: 200px;
}

.search-bar button {
    padding: 0.5rem 1rem;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background-color: #0056b3;
}


/* --- Main Content & Sections --- */
main {
    padding: 2rem 0;
}

.category-section {
    margin-bottom: 3rem;
}

.category-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card p {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.view-all-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #007bff; /* A standard, vibrant blue */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.view-all-btn:hover {
    background-color: #0056b3; /* A darker blue for the hover effect */
}

/* --- Ad Space Placeholder --- */
.ad-space {
    background: #e9ecef;
    border: 2px dashed #ced4da;
    text-align: center;
    padding: 40px 20px;
    margin: 2rem auto;
    color: #6c757d;
    font-weight: 500;
    border-radius: 8px;
}
.ad-space p {
    margin: 0;
}

/* --- Footer --- */
.site-footer {
    background-color: #343a40;
    color: #f8f9fa;
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    gap:1rem;
}

.footer-nav a {
    color: #f8f9fa;
    text-decoration: none;
}

.footer-nav a:hover {
    text-decoration: underline;
}

/* --- Individual Calculator Page Styles --- */
#calculator-container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 2rem auto; /* Center the container */
}

#calculator-container h1 {
    margin-bottom: 1.5rem;
}

.calculator-form .form-group {
    margin-bottom: 1.5rem;
}

.calculator-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.calculator-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.calculator-form button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calculator-form button:hover {
    background-color: #0056b3;
}

#results {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #e2f0ff;
    border: 1px solid #b3d7ff;
    border-radius: 5px;
    text-align: center;
}

#results h3 {
    margin-bottom: 0.5rem;
    color: #004085;
}

/* --- Search Results Page --- */
#search-query {
    color: var(--primary-color);
    font-style: italic;
}

#no-results {
    padding: 2rem;
    text-align: center;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    display: none; /* Initially hidden */
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .search-bar {
        width: 100%;
        margin-top: 1rem;
    }
    
    .search-bar input[type="search"] {
        width: 100%;
    }
	/* css/style.css -- ADD THIS TO THE END OF THE FILE */

/* --- Collapsible Mobile Menu --- */

/* Wrapper for the nav and search, for desktop view */
.collapsible-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Matches the gap in the old main-nav ul */
}

/* Hide the hamburger button on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1010; /* Ensures it's above other header content */
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* --- Responsive Menu (Mobile View) --- */
@media (max-width: 992px) { /* A wider breakpoint can be better for complex headers */
    .site-header .container {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    /* Show the hamburger button */
    .menu-toggle {
        display: block;
    }

    /* Hide the menu by default on mobile */
    .collapsible-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        background-color: var(--card-bg);
        padding: 1rem 0;
        margin-top: 1rem;
    }
    
    .main-nav {
        width: 100%;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .main-nav ul li a {
        padding: 0.5rem 0; /* Easier to tap */
        display: block;
    }

    .search-bar {
        width: 100%;
        margin-top: 1rem;
    }

    /* --- Styles for when the menu is OPEN --- */
    
    /* Use a class on the header to control the state */
    .site-header.nav-open .collapsible-menu {
        display: flex; /* Show the menu */
    }

    /* Animate the hamburger icon into an 'X' */
    .site-header.nav-open .menu-toggle .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .site-header.nav-open .menu-toggle .bar:nth-child(2) {
        opacity: 0;
    }
    .site-header.nav-open .menu-toggle .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}
}