/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

/* Visually hidden class for accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Header styles */
header {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-block;
}

.logo-image {
    height: 78px;
    vertical-align: middle;
}

/* Navigation styles */
nav {
    display: inline-block;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: #333;
    text-decoration: none;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
    font-weight: 500;
    font-size: 1em;
}

nav ul li a:hover {
    color: #007bff;
}

/* Dropdown menu */
.dropdown .dropdown-toggle {
    cursor: pointer;
}

.dropdown .dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    top: 100%;
    left: 0;
    border-radius: 5px;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu li a {
    padding: 12px 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.dropdown-menu li a:hover {
    background-color: #f4f4f4;
    color: #007bff;
}

/* Hamburger menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* Hero Section with Background */
.hero-background {
    background-image: url('../images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    background-color: #333;
    position: relative;
    color: white;
    padding: 60px 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-heading-image {
    max-width: 1000px;
    width: 100%;
    height: auto;
    margin-bottom: 5px;
}

.hero-content p {
    font-size: 1.2em;
    margin: 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

/* Content with Sidebars */
.content-with-sidebars {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1920px;
    margin: 0 auto;
}

/* Tools grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 415px);
    gap: 20px;
    padding: 20px;
    width: 1325px;
    justify-content: center;
}

.tool-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 20px;
    transition: transform 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-card a {
    text-decoration: none;
    color: #333;
}

.tool-card i {
    font-size: 2em;
    color: #007bff;
    margin-bottom: 10px;
}

.tool-card h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.tool-card p {
    color: #666;
    font-size: 0.9em;
}

/* Tool section */
.tool-section {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    gap: 20px;
}

.tool-container {
    flex: 1;
    max-width: 600px;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center; /* Center-align all content inside tool-container */
}

.tool-container h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the heading */
    gap: 10px;
}

.instructions {
    color: #666;
    margin-bottom: 20px;
}

/* Form styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center; /* Center-align form group content */
    margin: 0 auto;
    width: 100%;
    max-width: 300px; /* Ensure form groups don't stretch too wide */
}

.form-group label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    max-width: 200px; /* Ensure inputs/selects are not too wide */
}

/* Button styles */
button.calculate-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
    margin: 10px auto; /* Center the button */
}

/* Ensure buttons in forms are centered */
form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

button.calculate-btn:hover {
    background-color: #0056b3;
}

/* Result and email section */
#result,
#recommendations {
    margin-top: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

/* Tabular results */
#result table {
    width: 100%;
    max-width: 400px; /* Limit table width for better centering */
    margin: 0 auto; /* Center the table */
    border-collapse: collapse;
    margin-top: 10px;
}

#result table th,
#result table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

#result table th {
    background-color: #f4f4f4;
    font-weight: 600;
}

/* Email Section */
#emailSection {
    margin-top: 20px;
    text-align: center;
}

.email-input-row {
    margin-bottom: 20px;
}

.email-input-row input[type="email"] {
    padding: 8px;
    width: 100%;
    max-width: 300px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.email-buttons-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.email-buttons-row button {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
    padding: 8px 16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.email-buttons-row button:hover {
    background-color: #0056b3;
}

/* Ad sidebars */
.ad-sidebar-left,
.ad-sidebar-right {
    width: 160px;
    display: none;
}

@media (min-width: 1325px) {
    .ad-sidebar-left,
    .ad-sidebar-right {
        display: block;
    }
}

.ad-banner-bottom {
    text-align: center;
    padding: 20px;
}

/* Footer styles */
footer {
    background-color: #333;
    color: white;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-top {
    margin-bottom: 10px;
}

.footer-top a {
    color: #007bff;
    text-decoration: none;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: #007bff;
}

.footer-attribution {
    font-size: 0.9em;
    color: #ccc;
}

/* Contact form textarea */
.contact-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    resize: vertical;
    width: 100%;
    max-width: 300px; /* Match form group width */
}

/* Responsive design */
@media (max-width: 1325px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        display: none;
        width: 100%;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li {
        display: block;
    }

    nav ul li a {
        padding: 15px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .dropdown .dropdown-menu {
        position: static;
        background-color: #f4f4f4;
        box-shadow: none;
        max-height: none;
        overflow-y: visible;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
    }

    .logo-image {
        height: 65px;
    }

    .hero-background {
        padding: 40px 15px;
        min-height: 250px;
    }

    .hero-heading-image {
        max-width: 90%;
    }

    .hero-content p {
        font-size: 1em;
        text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    }

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

    .tool-section {
        flex-direction: column;
    }

    .tool-container {
        max-width: 100%;
    }
}