/* ============================================
   Web Tools — Emerald Design System
   Matched from ToolsGrove reference template
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Emerald Theme Color Palette */
    --primary: #059669;
    --primary-dark: #047857;
    --primary-deep: #065f46;
    --primary-light: #10b981;
    --soft-mint: #ecfdf5;
    --soft-mint-2: #d1fae5;
    --soft-mint-3: #f7fcf9;
    
    --ink: #0b1f18;
    --text-primary: #263a31;
    --text-secondary: #475569;
    --text-muted: #65776e;
    
    --background: #f8fafc;
    --surface: #ffffff;
    --border: rgba(6, 95, 70, 0.11);
    --border-green: rgba(5, 150, 105, 0.17);
    
    --grad-emerald: linear-gradient(135deg, #059669 0%, #047857 50%, #064e3b 100%);
    --grad-mint: linear-gradient(145deg, #ecfdf5, #d1fae5);
    
    --shadow-card: 0 10px 30px rgba(6, 95, 70, 0.05);
    --shadow-hover: 0 20px 45px rgba(5, 150, 105, 0.12);
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 100px;
    
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background) !important;
    color: var(--text-primary) !important;
    line-height: 1.6 !important;
    -webkit-font-smoothing: antialiased !important;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Highlight emphasis ──────────────────────── */
.highlight {
    background: linear-gradient(115deg, var(--primary-deep), var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Hero Section ────────────────────────────── */
.hero {
    padding: 4.5rem 0 5rem;
    background: radial-gradient(circle at 50% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 60%), var(--soft-mint-3);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.hero-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--soft-mint);
    border: 1px solid var(--soft-mint-2);
    color: var(--primary-dark);
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-heading {
    font-family: 'Sora', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--ink);
    max-width: 850px;
    margin: 0 auto 1.2rem;
    text-align: center;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2.5rem;
    text-align: center;
    line-height: 1.7;
}

/* Hero Search Bar */
.search-box-wrap {
    max-width: 680px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid var(--border-green);
    border-radius: var(--radius-pill);
    padding: 0.5rem 0.6rem 0.5rem 1.5rem;
    box-shadow: 0 16px 36px rgba(5, 150, 105, 0.08);
    transition: all 0.25s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(5, 150, 105, 0.16);
}

.search-box i {
    font-size: 1.2rem;
    color: var(--primary);
    margin-right: 0.8rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--ink);
}

.search-box button {
    background: var(--grad-emerald);
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-box button:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.quick-pills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.quick-pill {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.quick-pill:hover {
    background: var(--soft-mint);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

/* ── Section Titles ──────────────────────────── */
.section-heading {
    text-align: center;
    margin: 4.5rem 0 2.5rem;
}

.section-heading h2 {
    font-family: 'Sora', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.section-heading p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0.6rem auto 0;
}

/* ── Tool Cards Grid ─────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem;
    margin: 2rem 0;
}

.tool-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.8rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-green);
}

.tool-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--soft-mint);
    border: 1px solid var(--soft-mint-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.tool-icon-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.tool-category-badge {
    background: var(--soft-mint);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
}

.tool-card h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.6rem;
}

.tool-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: auto;
}

.tool-link {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.tool-card:hover .tool-link {
    gap: 10px;
    color: var(--primary);
}

.tool-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.8rem;
}

/* ── Converter Card Visual ───────────────────── */
.converter-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--soft-mint-3);
    border: 1px dashed var(--border-green);
    border-radius: 14px;
    padding: 0.8rem 1.2rem;
    margin-bottom: 1.2rem;
}

.conv-format {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.conv-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.conv-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.conv-arrow {
    color: var(--primary);
    font-size: 1rem;
}

/* ── Category Grid & Featured Card ────────────── */
.category-section-layout {
    display: grid;
    grid-template-columns: 1fr 2.2fr;
    gap: 2rem;
    margin: 2.5rem 0;
}

.featured-dark-card {
    background: var(--grad-emerald);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 16px 36px rgba(5, 150, 105, 0.2);
}

.featured-dark-card h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 1rem 0;
    line-height: 1.3;
}

.featured-dark-card p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.featured-dark-card .btn-light {
    background: #ffffff;
    color: var(--primary-dark);
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
}

.featured-dark-card .btn-light:hover {
    background: var(--soft-mint);
    transform: translateY(-2px);
}

.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.cat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.cat-card:hover {
    border-color: var(--border-green);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.cat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--soft-mint);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.cat-card h4 {
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

.cat-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── 4-Step Process Section ──────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 3rem 0;
}

.step-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    position: relative;
}

.step-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--grad-emerald);
    color: #ffffff;
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.25);
}

.step-card h4 {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.6rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Features Grid (Simpler) ─────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.feature-block {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.feature-block:hover {
    border-color: var(--border-green);
    transform: translateY(-4px);
}

.feature-block i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: block;
}

.feature-block h4 {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.6rem;
}

.feature-block p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── CTA Banner ──────────────────────────────── */
.cta-banner {
    background: var(--grad-emerald);
    border-radius: 32px;
    padding: 4.5rem 2rem;
    color: #ffffff;
    text-align: center;
    margin: 5rem 0;
    box-shadow: 0 20px 50px rgba(5, 150, 105, 0.25);
    position: relative;
    overflow: hidden;
}

.cta-banner h2 {
    font-family: 'Sora', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.cta-banner p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 650px;
    margin: 0 auto 2.5rem;
}

.cta-btn-group {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn-cta-white {
    background: #ffffff;
    color: var(--primary-dark);
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-cta-white:hover {
    background: var(--soft-mint);
    transform: translateY(-2px);
}

.btn-cta-outline {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-cta-outline:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.cta-trust-points {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    flex-wrap: wrap;
}

/* ── FAQ Accordion ───────────────────────────── */
.faq-wrap {
    max-width: 800px;
    margin: 3rem auto;
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-question {
    padding: 1.2rem 1.5rem;
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-answer {
    padding: 0 1.5rem 1.2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-item.open {
    border-color: var(--border-green);
}

/* ── About & Contact Cards ───────────────────── */
.about-section {
    background: var(--soft-mint-3);
    border: 1px solid var(--border-green);
    border-radius: 36px;
    padding: 4rem 3rem;
    margin: 4rem 0;
}

.contact-form {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--background);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.submit-btn {
    background: var(--grad-emerald);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

/* ==========================================================================
   GLOBAL OVERRIDES FOR ALL INDIVIDUAL TOOL PAGES IN /tools/*
   Enforces unified Emerald Green design across 180+ tool pages
   ========================================================================== */

/* Main Container Layout for Tool Pages */
.tool-container {
    max-width: 1100px !important;
    margin: 2.5rem auto 4rem !important;
    padding: 0 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    align-items: center !important;
}

/* Headings in Tool Pages */
.tool-container h1,
.tool-container h2,
.tool-container h3,
.article-section h2,
.article-section h3 {
    font-family: 'Sora', sans-serif !important;
}

.tool-container h1 {
    color: var(--ink) !important;
    font-weight: 800 !important;
}

.article-section h2 {
    border-bottom: 3px solid var(--primary-light) !important;
    color: var(--ink) !important;
}

.article-section h4 {
    border-left: 4px solid var(--primary) !important;
}

.article-section strong {
    color: var(--primary-dark) !important;
}

/* Override Tailwind & Custom Blue / Purple / Indigo background classes */
.bg-blue-500, .bg-blue-600, .bg-blue-700,
.bg-indigo-500, .bg-indigo-600, .bg-indigo-700,
.bg-purple-500, .bg-purple-600, .bg-purple-700,
.bg-violet-500, .bg-violet-600,
.btn-primary, .submit-btn,
button[type="submit"], button[onclick*="generate"], button[onclick*="convert"], button[onclick*="calculate"] {
    background-color: var(--primary) !important;
    background-image: var(--grad-emerald) !important;
    color: #ffffff !important;
    border-radius: var(--radius-pill) !important;
    border: none !important;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.22) !important;
    transition: all 0.2s ease !important;
}

/* Hover States */
.bg-blue-500:hover, .bg-blue-600:hover, .bg-blue-700:hover,
.bg-indigo-500:hover, .bg-indigo-600:hover, .bg-indigo-700:hover,
.bg-purple-500:hover, .bg-purple-600:hover, .bg-purple-700:hover,
.btn-primary:hover, .submit-btn:hover,
button[type="submit"]:hover, button[onclick]:hover {
    background-color: var(--primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.32) !important;
}

/* Unit buttons / Active Toggles */
.unit-btn.active, .unit-btn.is-active, .tab-btn.active {
    background-color: var(--primary) !important;
    background-image: var(--grad-emerald) !important;
    color: #ffffff !important;
    border-color: var(--primary-dark) !important;
}

/* Override Text Accent Colors */
.text-blue-500, .text-blue-600, .text-blue-700,
.text-indigo-500, .text-indigo-600, .text-indigo-700,
.text-purple-500, .text-purple-600, .text-purple-700,
.text-violet-600 {
    color: var(--primary-dark) !important;
}

/* Override Border Accent Colors */
.border-blue-500, .border-indigo-500, .border-purple-500, .border-indigo-600 {
    border-color: var(--border-green) !important;
}

/* Form Input & Select Controls Focus States */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
    outline: none !important;
}

/* General Tool Card Containers */
.tool-container .bg-white {
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--radius-xl) !important;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .hero-heading { font-size: 2.5rem; }
    .category-section-layout { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .hero-heading { font-size: 2rem; }
    .steps-grid { grid-template-columns: 1fr; }
    .search-box { flex-direction: column; padding: 0.8rem; border-radius: 20px; }
    .search-box input { width: 100%; margin-bottom: 0.6rem; }
    .search-box button { width: 100%; }
}