/**
 * Modern Tool Page Styles
 * Consistent styling for all tool pages
 */

/* Breadcrumbs */
.breadcrumbs {
    background: var(--bg-secondary, #f8fafc);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-top: 72px;
}

.breadcrumbs-container {
    max-width: 1400px;
    margin-left: 1.5rem; /* Left-aligned with small left margin */
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* Adjust breadcrumbs for larger screens */
@media (min-width: 1300px) {
    .breadcrumbs-container {
        max-width: min(1400px, calc(100vw - 380px - 3rem));
    }
}

@media (min-width: 1440px) {
    .breadcrumbs-container {
        max-width: min(1400px, calc(100vw - 420px - 3rem));
    }
}

.breadcrumbs a {
    color: var(--primary, #6366f1);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumbs a:hover {
    opacity: 0.8;
}

.breadcrumb-separator {
    color: var(--text-muted, #94a3b8);
}

.breadcrumb-current {
    color: var(--text-secondary, #475569);
    font-weight: 500;
}

/* Tool Header */
.tool-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 3rem 1.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.tool-header-container,
.tool-container {
    max-width: 1200px;
    margin-left: 1.5rem; /* Left-aligned with small left margin */
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Optimize for larger screens without ads */
@media (min-width: 1300px) {
    .tool-header-container,
    .tool-container {
        max-width: min(1200px, calc(100vw - 380px - 3rem)); /* Reserve space for right ads */
        margin-left: 1.5rem;
    }
}

@media (min-width: 1440px) {
    .tool-header-container,
    .tool-container {
        max-width: min(1200px, calc(100vw - 420px - 3rem)); /* Reserve space for larger right ads */
        margin-left: 1.5rem;
    }
}

@media (min-width: 1600px) {
    .tool-header-container,
    .tool-container {
        max-width: 1400px; /* Use more space on very large screens */
        margin-left: 1.5rem;
    }
}

.tool-header-content {
    text-align: center;
}

.tool-page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.02em;
}

.tool-page-description {
    font-size: 1.125rem;
    color: var(--text-secondary, #475569);
    max-width: 700px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tool-category-badge,
.tool-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tool-category-badge {
    background: var(--primary, #6366f1);
    color: white;
}

.tool-badge {
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border, #e2e8f0);
}

/* Tool Main */
.tool-main {
    padding: 3rem 1.5rem;
    min-height: 60vh;
}

/* Dedicated Layout Wrapper for Content + Ads (Desktop only) */
@media (min-width: 1300px) {
    .tool-main {
        display: grid;
        grid-template-columns: 1fr 356px; /* Content + Ad column (336px + 20px gap) */
        gap: 1.5rem;
        padding: 3rem 1.5rem;
        max-width: 100vw;
        margin: 0;
    }
    
    /* Content area in dedicated left column */
    .tool-main > .tool-container {
        grid-column: 1;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Ad column - dedicated right space (grid column 2) */
    .tool-main > .ad-right-column {
        grid-column: 2;
    }
}

@media (min-width: 1440px) {
    .tool-main {
        grid-template-columns: 1fr 372px; /* 336px + 36px gap */
    }
}

.tool-container {
    max-width: 1200px;
    margin-left: 1.5rem; /* Left-aligned with small left margin */
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Optimize for larger screens */
@media (min-width: 1300px) {
    .tool-container {
        max-width: min(1200px, calc(100vw - 380px - 3rem)); /* Reserve space for right ads */
        margin-left: 1.5rem;
    }
}

@media (min-width: 1440px) {
    .tool-container {
        max-width: min(1200px, calc(100vw - 420px - 3rem)); /* Reserve space for larger right ads */
        margin-left: 1.5rem;
    }
}

@media (min-width: 1600px) {
    .tool-container {
        max-width: 1400px; /* Use more space on very large screens */
        margin-left: 1.5rem;
    }
}

/* Tool Form Card */
.tool-form-card {
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tool-form-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #0f172a);
}

/* Tool Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #0f172a);
    font-size: 0.9375rem;
}

.input-field,
.textarea-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    transition: all 0.2s;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #0f172a);
}

.textarea-field {
    min-height: 150px;
    resize: vertical;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.input-field:focus,
.textarea-field:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Tool Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary, #6366f1);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border, #e2e8f0);
}

.btn-secondary:hover {
    background: var(--bg-tertiary, #f1f5f9);
    border-color: var(--primary, #6366f1);
    color: var(--primary, #6366f1);
}

/* Results Card */
.results-card {
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.results-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #0f172a);
}

.result-output {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.9375rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text-primary, #0f172a);
}

/* Dark Mode */
[data-theme="dark"] .breadcrumbs {
    background: var(--bg-secondary, #1e293b);
    border-bottom-color: var(--border, #334155);
}

[data-theme="dark"] .tool-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .tool-form-card,
[data-theme="dark"] .results-card {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border, #334155);
}

[data-theme="dark"] .input-field,
[data-theme="dark"] .textarea-field,
[data-theme="dark"] .result-output {
    background: var(--bg-tertiary, #334155);
    border-color: var(--border, #334155);
    color: var(--text-primary, #f1f5f9);
}

/* Responsive */
@media (max-width: 767px) {
    .breadcrumbs {
        margin-top: 64px;
        padding: 0.75rem 1rem;
    }

    .tool-header {
        padding: 2rem 1rem;
    }

    .tool-main {
        padding: 2rem 1rem;
    }

    .tool-form-card {
        padding: 1.5rem;
    }
}

/* ==================== FAQ Accordion ==================== */
.faq-item {
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.faq-question {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    text-align: left;
    font-family: inherit;
    gap: 0.75rem;
    line-height: 1.4;
}
.faq-question:hover {
    color: var(--accent, #4f46e5);
}
.faq-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    color: var(--text-secondary, #64748b);
    line-height: 1.7;
    font-size: 0.9rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 0 1rem 0;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}
[data-theme="dark"] .faq-question {
    color: var(--text-primary, #f1f5f9);
}
[data-theme="dark"] .faq-answer {
    color: var(--text-secondary, #94a3b8);
}

