/* Removed redundant @import for performance - fonts are loaded in index.html */

:root {
    --primary-gradient: linear-gradient(90deg, #11998e, #38ef7d);
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #11998e;
    --accent-hover: #0e837a;
    --header-height: 80px;
    --container-width: 1200px;
    --transition-speed: 0.3s;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: var(--primary-gradient);
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    white-space: nowrap;
}

.logo-icon-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

.nav-center {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.header-search-container {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
    position: relative;
    width: 100%;
}

.header-search-container:focus-within {
    background: rgba(255, 255, 255, 0.25);
}

.header-search-input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    padding: 0.5rem 1.2rem;
    outline: none;
    font-size: 0.95rem;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header-search-btn {
    background: none;
    border: none;
    color: white;
    padding: 0 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* All Tools Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    min-width: 250px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 1rem 0;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: var(--accent-color);
}

.dropdown-item i {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--accent-color);
}

.menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Sidebar Overlay */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    padding: 1.5rem;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Home Page Tool Grid */
.tools-section {
    padding: 4rem 1.5rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    min-height: 800px; /* Reserve space for initial tools to prevent footer jump */
}

.ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    overflow: hidden;
}

.ad-top {
    min-height: 90px;
    margin-bottom: 2rem;
}

.ad-bottom {
    min-height: 280px;
    margin-top: 2rem;
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.load-more-container.hidden {
    display: none;
}

.tool-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-decoration: none;
    color: #0c770e;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.tool-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    flex-shrink: 0; /* Prevent icon collapse */
}

.tool-card-icon i {
    width: 1.75rem;
    height: 1.75rem;
}

.tool-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tool-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Tool Page Layout */
.tool-view {
    padding: 3rem 0;
    flex: 1;
}

.tool-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 992px) {
    .tool-layout-grid {
        grid-template-columns: 1fr 320px;
    }
}

.tool-main-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tool-container {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tool-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

/* Desktop Sidebar Tools */
.sidebar-desktop {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sd-box {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.sd-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-color);
    padding-left: 0.75rem;
}

.sd-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sd-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    background: #f8f9fa;
}

.sd-item:hover {
    background: #eef2f3;
    color: var(--accent-color);
}

.sd-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent-color);
}

/* SEO Content Section */
.content-section {
    margin-top: 2rem;
    width: 100%;
}

.content-wrapper {
    background: white;
    padding: 3.5rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    line-height: 1.8;
}

.content-wrapper h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.content-wrapper h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-wrapper p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s;
}

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

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent-color);
}

.autocomplete-info {
    display: flex;
    flex-direction: column;
}

.autocomplete-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.autocomplete-category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Home Page Search */
.hero {
    background: white;
    padding: 6rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* Footer Design */
.footer {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
    color: white;
    text-decoration: none;
}

/* --- Universal Tool Component Framework --- */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.35);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.tool-ui-card {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tool-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.tool-input:focus {
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(17, 153, 142, 0.1);
}

.tool-result-focus {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 2.5rem;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin: 1rem 0;
}

.tool-result-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.tool-result-label {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

.tool-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
}

.tool-metric-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.tool-metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.tool-metric-val {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.tool-metric-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.tool-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 1.25rem;
    margin-top: 1rem;
}

.tool-stage {
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-stage:hover {
    background: #f1f5f9;
    border-color: var(--accent-color);
}

.tool-stage-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-color);
    opacity: 0.2;
}

.tool-columns {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 992px) {
    .tool-columns {
        grid-template-columns: 1fr;
    }
}

.tool-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

.tool-preset-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tool-preset-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.tool-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.tool-toggle.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(17, 153, 142, 0.1);
}

.tool-well {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- Sidebar Green Info Cards --- */
.sd-green-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sd-green-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.sd-benefits-list {
    list-style: none;
    padding: 0;
}

.sd-benefit-item {
    padding: 0.75rem 0;
    font-size: 0.95rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px dashed #dcfce7;
}

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

.sd-faq-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sd-faq-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}

.sd-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sd-faq-q {
    font-weight: 700;
    color: #065f46;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: block;
}

.sd-faq-a {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
}

@media (max-width: 991px) {
    .header {
        height: auto !important;
        min-height: var(--header-height);
        padding: 0.75rem 0;
    }
    .nav {
        flex-wrap: wrap !important;
        gap: 0.75rem;
    }
    .nav-left {
        order: 1;
        flex: auto; /* Allow logo to take only needed space */
    }
    .nav-right {
        order: 2;
        flex: auto; /* Allow button to take only needed space */
    }
    .nav-center {
        order: 3;
        flex-basis: 100%;
        width: 100%;
        margin: 0;
        max-width: none;
        display: block !important;
    }
    .header-search-container {
        display: flex !important;
        background: rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .tool-container {
        padding: 1.5rem;
    }
    .content-wrapper {
        padding: 2rem;
    }
    .footer-content {
        gap: 2rem;
        text-align: center;
    }
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.15rem;
    }
    .logo-icon-box {
        padding: 0.35rem;
    }
    .logo-icon {
        width: 1.15rem;
        height: 1.15rem;
    }
    .dropdown-toggle {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.35rem;
    }
    .dropdown-toggle i {
        width: 14px;
        height: 14px;
    }
    .nav {
        gap: 0.5rem;
    }
}
