:root {
    --primary-color: #00d09c;
    --text-main: #44475b;
    --text-light: #7c7e8c;
    --bg-body: #f8f9fb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --heading-color: #1e2132;
    --secondary-color: #44475b;
    --container-max-width: 1000px;
    --touch-target: 44px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* --- Navbar Styles --- */
.main-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px; /* Slightly taller for better breathing room */
}

.nav-logo {
    text-decoration: none;
    color: var(--heading-color);
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.nav-links {
    display: flex;
    gap: 16px; /* Increased padding to prevent bunching */
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    margin-left: 20px;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    margin-left: 10px;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 15px;
    min-height: var(--touch-target);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.dropbtn:hover {
    background: var(--bg-body);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 16px;
    z-index: 1;
    top: 100%;
    left: 0;
    border: 1px solid var(--border-color);
}

.nav-links div.nav-dropdown:nth-last-child(-n+2) .dropdown-content {
    right: 0;
    left: auto;
}

.dropdown-section {
    margin-bottom: 12px;
}

.dropdown-section:last-child {
    margin-bottom: 0;
}

.dropdown-header {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-left: 14px;
    display: block;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 14px;
    min-height: var(--touch-target);
    box-sizing: border-box;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(0, 208, 156, 0.08);
    color: var(--primary-color);
    padding-left: 18px;
}

.nav-search {
    position: relative;
    margin-left: 10px;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    width: 380px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    overflow: hidden;
    z-index: 2000;
    animation: fadeInScale 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-results-list {
    max-height: 60vh;
    overflow-y: auto;
}

/* Custom Scrollbar */
.search-results-list::-webkit-scrollbar {
    width: 6px;
}

.search-results-list::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.search-results-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.search-header {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(248, 249, FB, 0.8);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
}

.search-no-results {
    padding: 30px 20px;
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

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

.search-result-item:hover, .search-result-item.selected {
    background: rgba(0, 208, 156, 0.04);
}

.result-icon-wrapper {
    width: 40px;
    height: 40px;
    background: var(--bg-body);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s;
    flex-shrink: 0;
}

.search-result-item:hover .result-icon-wrapper, 
.search-result-item.selected .result-icon-wrapper {
    background: rgba(0, 208, 156, 0.1);
    color: var(--primary-color);
    transform: scale(1.05);
}

.search-result-item .result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.result-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-item .result-name {
    font-size: 15px;
    font-weight: 700;
    color: #333333;
    transition: color 0.2s;
}

.category-badge {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--bg-body);
    color: var(--text-light);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.search-result-item:hover .result-name, 
.search-result-item.selected .result-name {
    color: var(--primary-color);
}

.search-result-item:hover .category-badge, 
.search-result-item.selected .category-badge {
    background: rgba(0, 208, 156, 0.15);
    color: var(--primary-color);
}

.search-result-item .result-desc {
    font-size: 12px;
    color: #666666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-arrow {
    color: var(--primary-color);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-10px);
}

.search-result-item:hover .result-arrow, 
.search-result-item.selected .result-arrow {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 950px) {
    .search-results-dropdown {
        width: calc(100vw - 40px);
        position: absolute;
        top: 60px;
        left: 20px;
        box-shadow: 0 25px 60px rgba(0,0,0,0.25);
        border: 1px solid var(--border-color);
        margin-bottom: 0;
        z-index: 2000;
    }
}

.nav-search input {
    padding: 10px 12px 10px 38px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.08); /* Thinner, professional border */
    background: var(--bg-body);
    font-size: 13px;
    font-weight: 500;
    width: 140px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); /* Very subtle shadow */
}

.nav-search input:focus {
    width: 200px;
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 208, 156, 0.08); /* Premium focus shadow */
}

.nav-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Responsive Nav */
@media (max-width: 950px) { /* Increased breakpoint to prevent overlap */
    .mobile-toggle {
        display: block !important;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 24px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 15px 30px rgba(0,0,0,0.08);
        gap: 4px;
        z-index: 999;
        margin-left: 0;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

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

    .nav-search {
        width: 100%;
        margin: 0 0 16px 0 !important;
        order: -1; /* Keep search at top in mobile menu */
    }

    .nav-search input {
        width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropbtn {
        width: 100%;
        justify-content: space-between;
        padding: 14px 16px;
        font-size: 15px;
    }

    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding: 0 0 8px 16px;
        width: 100%;
        min-width: 0;
        background: transparent;
    }

    .nav-dropdown.active .dropdown-content {
        display: block;
    }
}

/* --- Hero & Layout --- */
.hero-section {
    text-align: center;
    padding: 60px 0 80px;
    background: radial-gradient(circle at top, rgba(0, 208, 156, 0.05) 0%, transparent 70%);
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- Trust Section --- */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 80px;
}

@media (max-width: 768px) {
    .trust-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section h1 {
        font-size: 32px;
    }
}

.trust-item {
    text-align: center;
    padding: 20px;
}

.trust-item div.icon-box {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.trust-item .icon-box svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    stroke-width: 2;
}

.trust-item h4 {
    font-size: 18px;
    margin: 0 0 8px;
    color: var(--heading-color);
}

.trust-item p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* --- Tool Cards --- */
.category-section {
    margin-bottom: 80px;
}

.category-header {
    margin-bottom: 30px;
    text-align: center;
}

.category-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--heading-color);
    margin: 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-body);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.tool-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    stroke-width: 1.5;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

.tool-content h3 {
    font-size: 18px;
    margin: 0 0 8px;
    font-weight: 700;
}

.tool-content p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* --- Mega Footer --- */
.mega-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 100px 20px 80px;
    margin-top: 120px;
    width: 100%;
    box-sizing: border-box;
}

.footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 50px;
    text-align: left;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-light);
    max-width: 300px;
    margin: 0;
}

.footer-column h4 {
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 28px;
    color: var(--heading-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 16px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.footer-bottom {
    max-width: var(--container-max-width);
    margin: 80px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
}

.footer-badges {
    display: flex;
    gap: 12px;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(0, 208, 156, 0.06);
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Tool Page Shared Layout --- */
.back-link {
    text-decoration: none;
    color: var(--text-light);
    font-size: 14px;
    margin-top: 40px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    align-self: flex-start;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    min-height: var(--touch-target);
}

.back-link:hover {
    color: var(--primary-color);
}

.tool-container {
    max-width: var(--container-max-width);
    width: 100%;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    padding: 48px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .tool-container {
        padding: 30px 20px;
        border-radius: 0;
    }
    
    .tool-header h1 {
        font-size: 24px;
    }
}

.tool-header {
    margin-bottom: 40px;
}

.tool-header h1 {
    font-size: 32px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-header p.description {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-body);
    margin-bottom: 40px;
    position: relative;
}

.upload-area .local-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-color);
    background: white;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: white;
}

.upload-area .icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.upload-area input {
    display: none;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn:hover {
    background: #00b386;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 208, 156, 0.2);
}

.btn:disabled {
    background: #e5e7eb;
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- SEO Section in Tools --- */
.seo-section {
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
    padding-top: 60px;
}

.seo-section h2 {
    font-size: 24px;
    margin-bottom: 32px;
    color: var(--heading-color);
}

.faq-item {
    margin-bottom: 32px;
}

.faq-item h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.faq-item p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0;
}

@media (max-width: 1100px) {
    .footer-container {
        grid-template-columns: 1.5fr 1fr 1fr;
        row-gap: 60px;
    }
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    .footer-brand {
        grid-column: span 2;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-brand {
        grid-column: span 1;
        align-items: center;
    }
    .footer-brand p {
        max-width: 100%;
    }
    .footer-badges {
        justify-content: center;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .footer-links a:hover {
        transform: none;
    }
}

/* --- Skeleton & Layout Stability --- */
.chart-container canvas {
    min-height: 250px;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.result-placeholder {
    min-height: 100px;
    width: 100%;
    margin: 20px 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
    .preview-grid {
        grid-template-columns: 1fr !important;
    }
}

.input-wrapper input[type="number"], 
.input-wrapper input[type="text"],
select, 
.btn {
    min-height: var(--touch-target);
}

