:root {

    --brand-primary: #3B82F6;
    --brand-secondary: #10B981;
    --brand-accent: #8B5CF6;

    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --success: #10B981;
    --error: #EF4444;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --text-inverse: #FFFFFF;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition-base: 200ms ease-in-out;
    
    --z-40: 40;
    --z-50: 50;
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.15s ease, color 0.15s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity var(--transition-base);
}

a:hover {
    opacity: 0.8;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-50);
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    transition: all var(--transition-base);
    height: 72px;
}

[data-theme="dark"] .navbar {
    background: rgba(31, 41, 55, 0.95);
    border-bottom-color: var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-icon img {
    height: 40px;
    width: auto;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* This will now correctly space the three items */
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

.nav-center {
    display: none; /* Keep this for mobile */
}

@media (min-width: 768px) {
    .nav-center {
        display: block; /* Change from none to block on desktop */
        /* All the problematic absolute positioning rules are GONE */
    }
}

.nav-links {
    display: flex;
    gap: 3.5rem;
    margin-left: 1rem;
    margin-right: 1rem;
}

.nav-link {
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    margin-left: 1rem;
    margin-right: 1rem;
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    font-size: 0.9rem;
}
.back-button .brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
.back-button .brand-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--brand-primary);
    stroke-width: 2.5;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}
@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}
.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-base);
}
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

.mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: var(--z-40);
    padding: var(--space-4);
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color, #E5E7EB);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}
.theme-toggle:hover {
    transform: translateY(-1px);
}

.footer {
    padding: var(--space-12) 0 var(--space-6);
    background: var(--bg-primary);
    color: var(--text-inverse);
}
.footer-main {
    display: grid;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}
@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr 2fr;
    }
}
.footer-sections {
    display: grid;
    gap: var(--space-8);
}
@media (min-width: 768px) {
    .footer-sections {
        grid-template-columns: repeat(3, 1fr);
    }
}
.footer-section {
    text-align: center;
}
@media (min-width: 768px) {
    .footer-section {
        text-align: left;
    }
}
.footer-section h4 {
    margin-bottom: var(--space-4);
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-inverse);
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: var(--space-2);
}
.footer-links a {
    color: var(--gray-400);
}
.footer-social {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
    justify-content: center;
}
@media (min-width: 768px) {
    .footer-social {
        justify-content: flex-start;
    }
}
.footer-social a {
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    color: var(--gray-400);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: var(--space-6);
    margin-top: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
}
@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}
.footer-copyright p, .footer-legal a {
    color: var(--gray-400);
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    .footer-main {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* ADD THIS RULE */
    .footer-brand-section {
        width: 100%;
    }

    .footer-brand {
        width: 100%;
    }
    
    .footer-sections {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .footer-section {
        width: 100%;
    }
    .footer-links {
        padding: 0;
    }
}

.footer-brand img {
    display: block;      /* Ensures proper block-level behavior for centering */
    height: auto;        /* Maintains the aspect ratio */
    max-width: 180px;    /* The largest the logo will get on desktop */
    margin: 0 auto;      /* A robust way to center an image */
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.tool-hero {
    padding: 120px 0 80px;
    position: relative;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
}
.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.hero-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}
.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
}
.hero-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}
