/* --- Global Styles & Variables --- */
:root {
    --primary-color: #2c3e50;
    /* Dark Blue/Grey */
    --secondary-color: #3498db;
    /* Bright Blue */
    --accent-color: #e74c3c;
    /* Red */
    --text-color: #34495e;
    /* Darker Grey */
    --headings-color: #2c3e50;
    /* Same as primary for consistency */
    --bg-color: #f4f7f6;
    /* Slightly cooler light grey */
    --white: #ffffff;
    --font-main: 'Inter', sans-serif;
    /* Updated to Inter */
    --font-alt: 'Merriweather', serif;
    /* Updated to Merriweather for headings */
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Softer, deeper shadow */
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12);
    /* Hover shadow */
    --gradient-hero: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    /* Slightly tighter line height */
    margin: 0;
    font-size: 16px;
    /* Base font size */
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    /* Increased margin */
    padding: 0 25px;
    /* Increased padding */
    gap: 40px;
    /* Increased gap */
}

.main-content {
    flex: 3;
}

.sidebar {
    flex: 1;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    /* Added ease for smoother transition */
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
    /* Added underline on hover for clarity */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-alt);
    color: var(--headings-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
    /* Bold headings */
}

h1 {
    font-size: 2.8em;
}

h2 {
    font-size: 2.2em;
}

h3 {
    font-size: 1.8em;
}

h4 {
    font-size: 1.4em;
}

/* --- Header & Navigation --- */
.main-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    padding: 18px 25px;
    /* Adjusted padding */
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo a {
    font-size: 2em;
    /* Slightly larger logo */
    font-weight: 800;
    /* Extra bold */
    color: var(--primary-color);
    text-transform: uppercase;
    /* Uppercase for logo */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    /* Increased gap */
    margin: 0 auto;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 600;
    padding: 10px 15px;
    /* Adjusted padding */
    border-radius: 6px;
    /* Slightly more rounded */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links a:hover,
.dropdown:hover>a {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    flex-direction: column;
    position: absolute;
    background-color: var(--white);
    min-width: 240px;
    /* Slightly wider */
    box-shadow: var(--shadow);
    z-index: 1;
    list-style: none;
    padding: 10px 0;
    border-radius: 8px;
    margin-top: 10px;
    /* Increased margin-top */
    border: 1px solid #e0e0e0;
    /* Subtle border */
}

.dropdown:hover .dropdown-content {
    display: flex;
}

.dropdown-content li a {
    padding: 12px 20px;
    /* Adjusted padding */
    display: block;
    color: var(--text-color);
    font-weight: 400;
}

.dropdown-content li a:hover {
    background-color: var(--bg-color);
    color: var(--secondary-color);
}

.hamburger-menu {
    display: none;
    /* Hide by default on desktop */
}

/* --- Main Content & Articles --- */
.article-page,
.tool-page,
.error-page {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    /* More rounded corners */
    box-shadow: var(--shadow);
}

.article-page header {
    border-bottom: 1px solid #e0e0e0;
    /* Lighter border */
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.article-meta {
    font-size: 0.95em;
    color: #7f8c8d;
    /* Muted grey */
}

/* --- Homepage Specific --- */
.hero {
    text-align: center;
    padding: 120px 25px;
    /* Increased padding */
    background: var(--gradient-hero);
    /* Use variable */
    color: var(--white);
    border-radius: 16px;
    /* More rounded */
    margin-bottom: 50px;
    box-shadow: var(--shadow);
}

.hero h1 {
    color: var(--white);
    font-size: 3.5em;
    /* Larger hero heading */
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2em;
    max-width: 700px;
    margin: 0 auto 30px auto;
    line-height: 1.8;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 16px 32px;
    /* Adjusted padding */
    border-radius: 8px;
    /* More rounded */
    font-weight: bold;
    display: inline-block;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-transform: uppercase;
    /* Uppercase text */
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: #c0392b;
    /* Darker red on hover */
    transform: translateY(-3px);
    /* More pronounced lift */
}

.search-form {
    display: flex;
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    overflow: hidden;
    /* Ensures input and button corners are rounded */
}

.search-input {
    flex-grow: 1;
    padding: 15px 20px;
    /* Adjusted padding */
    border: 1px solid #ccc;
    border-right: none;
    /* Remove border between input and button */
    font-size: 1.1em;
    outline: none;
}

.search-btn {
    background-color: var(--secondary-color);
    border: none;
    color: var(--white);
    padding: 0 25px;
    /* Adjusted padding */
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #2980b9;
    /* Darker blue on hover */
}

.featured-articles,
.featured-tools {
    padding: 80px 0;
    /* Increased padding */
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: var(--headings-color);
}

.article-grid,
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Adjusted minmax */
    gap: 30px;
}

.article-card,
.tool-card {
    background: var(--white);
    padding: 30px;
    /* Increased padding */
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover,
.tool-card:hover {
    transform: translateY(-8px);
    /* More pronounced lift */
    box-shadow: var(--shadow-hover);
}

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

.article-card p,
.tool-card p {
    font-size: 0.95em;
    line-height: 1.7;
    flex-grow: 1;
}

.article-card a,
.tool-card a {
    margin-top: 15px;
    align-self: flex-start;
    font-weight: 600;
}

/* --- Sidebar --- */
.sidebar-widget {
    background: var(--white);
    padding: 30px;
    /* Increased padding */
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    border-bottom: 1px solid #e0e0e0;
    /* Lighter border */
    padding-bottom: 15px;
    margin-top: 0;
    font-size: 1.6em;
    display: flex;
    align-items: center;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
}

.sidebar-widget ul li a {
    display: block;
    padding: 12px 0;
    /* Adjusted padding */
    border-bottom: 1px solid #e0e0e0;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.sidebar-widget ul li a:hover {
    color: var(--secondary-color);
}

.sidebar-widget ul li:last-child a {
    border-bottom: none;
}

/* --- Calculators --- */
.calculator-container {
    max-width: 650px;
    /* Slightly wider */
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
    /* Increased margin */
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    /* Increased margin */
    font-weight: 600;
    color: var(--headings-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px;
    /* Increased padding */
    border: 1px solid #dcdcdc;
    /* Lighter border */
    border-radius: 6px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    /* Focus shadow */
    outline: none;
}

.results-container {
    margin-top: 40px;
    /* Increased margin */
    background: var(--bg-color);
    padding: 30px;
    /* Increased padding */
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    /* Subtle border */
}

.results-container h2 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    border-bottom: 1px solid #dcdcdc;
    padding-bottom: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    /* Increased padding */
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.1em;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item strong {
    color: var(--headings-color);
}

.error-message {
    color: var(--accent-color);
    margin-top: 20px;
    font-weight: bold;
    background-color: #fdeded;
    border: 1px solid #fbc2c4;
    padding: 15px;
    border-radius: 8px;
}

.error-message:empty {
    display: none;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 80px 25px 40px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 20px;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.2em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p {
    font-size: 0.95em;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
    /* Subtle movement */
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom .disclaimer {
    font-size: 0.85em;
    max-width: 800px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* --- Quiz Styles --- */
.answers {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    /* Increased gap */
    margin: 25px 0;
}

.answer-btn {
    width: 100%;
    padding: 18px;
    /* Increased padding */
    background-color: var(--bg-color);
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 1.1em;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    color: var(--text-color);
}

.answer-btn:hover {
    background-color: #e0e0e0;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.answer-btn.selected {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
    transform: translateY(0);
}

#results-container h3 {
    color: var(--primary-color);
    font-size: 2em;
    /* Larger results heading */
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.score-container {
    text-align: center;
    margin: 40px 0;
}

.score-circle {
    width: 180px;
    /* Larger circle */
    height: 180px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    /* Changed to secondary color */
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5em;
    /* Larger font */
    font-weight: bold;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    /* More prominent shadow */
}

.sidebar-widget h3 i,
.sidebar-widget h4 i,
.sidebar-widget ul li a i {
    margin-right: 10px;
    color: var(--secondary-color);
    /* Consistent icon color */
}

/* --- Calculator Results --- */
.results-container {
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 40px;
    animation: fadeIn 0.5s ease-out;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.result-label {
    display: block;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 600;
}

.result-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
}

.result-value.highlight {
    color: var(--secondary-color);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-top: 30px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.ad-placeholder {
    background-color: #f0f4f7;
    /* Lighter background */
    border: 1px dashed #c0d0da;
    /* Muted border */
    padding: 25px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 8px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ad-placeholder h4 {
    margin-top: 0;
    color: #7f8c8d;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {

    /* Adjusted breakpoint */
    .container {
        flex-direction: column;
        margin: 30px auto;
        padding: 0 15px;
        gap: 30px;
    }

    .main-content {
        flex: 1;
        /* Take full width */
    }

    .sidebar {
        flex: 1;
        /* Take full width */
    }

    .hero {
        padding: 80px 15px;
    }

    .hero h1 {
        font-size: 2.5em;
    }

    .section-title {
        font-size: 2em;
    }

    .article-grid,
    .tools-grid {
        grid-template-columns: 1fr;
        /* Single column on smaller screens */
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-section {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        margin-bottom: 0;
    }

    .nav-links {
        display: none;
        /* Hidden by default on mobile */
        width: 100%;
        flex-direction: column;
        text-align: center;
        background-color: var(--white);
        box-shadow: var(--shadow);
        position: absolute;
        top: 70px;
        /* Below header */
        left: 0;
        padding: 20px 0;
        border-radius: 0 0 8px 8px;
    }

    .nav-links.nav-active {
        display: flex;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .dropdown-content {
        box-shadow: none;
        border: none;
        margin-top: 0;
        background-color: var(--bg-color);
        padding: 0;
    }

    .dropdown-content li a {
        padding: 10px 30px;
    }

    .hamburger-menu {
        display: flex;
        /* Show hamburger menu */
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
        position: absolute;
        /* Position it */
        right: 25px;
        /* Align to right */
        top: 25px;
    }

    .hamburger-menu span {
        width: 100%;
        height: 3px;
        background: var(--headings-color);
        border-radius: 10px;
        transition: all 0.3s linear;
        position: relative;
    }

    .hamburger-menu.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger-menu.open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2em;
    }

    h2 {
        font-size: 1.8em;
    }

    h3 {
        font-size: 1.4em;
    }

    .hero {
        padding: 60px 10px;
    }

    .hero h1 {
        font-size: 2em;
    }

    .btn-primary {
        padding: 12px 25px;
        font-size: 0.9em;
    }

    .search-input {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .search-btn {
        padding: 0 15px;
        font-size: 1em;
    }

    .article-page,
    .tool-page,
    .error-page {
        padding: 25px;
    }

    .sidebar-widget {
        padding: 20px;
    }

    .main-footer {
        padding: 40px 15px;
    }
}

/* Ad Placeholder Styles - Consolidated above */


.ad-container {
    margin: 20px 0;
    text-align: center;
}