/* ── Light mode values (no var()) ── */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: transparent;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #E2E8F0;
    flex-wrap: wrap;
    background: transparent;
}
.theme-dark .tool-header {
    border-bottom-color: #334155;
}

.tool-header .traffic-lights {
    display: flex;
    gap: 8px;
}
.tool-header .traffic-light {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}
.tool-header .traffic-light.red   { background: #ff5f57; }
.tool-header .traffic-light.yellow{ background: #ffbd2e; }
.tool-header .traffic-light.green { background: #28c840; }

.tool-header .tool-title {
    font-family: 'Clash Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0A192F;
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-dark .tool-header .tool-title {
    color: #F8FAFC;
}

.tool-header .tool-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-body {
    padding: 1.5rem 0;
}

/* ── TABS: horizontal, above input ── */
.tool-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}
.theme-dark .tool-tabs {
    border-bottom-color: #334155;
}

.tool-tabs button {
    flex: 0 0 auto;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}
.theme-dark .tool-tabs button {
    color: #94A3B8;
}

.tool-tabs button.active {
    color: #0A192F;
    border-bottom-color: #0A192F;
}
.theme-dark .tool-tabs button.active {
    color: #F8FAFC;
    border-bottom-color: #F8FAFC;
}

.tool-tabs button:hover {
    color: #0A192F;
}
.theme-dark .tool-tabs button:hover {
    color: #F8FAFC;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Inputs ── */
.tool-input,
.tool-textarea {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 0;
    padding: 0.75rem 1rem;
    width: 100%;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #0A192F;
    transition: border-color 0.2s;
}
.theme-dark .tool-input,
.theme-dark .tool-textarea {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

.tool-input:focus,
.tool-textarea:focus {
    border-color: #2ECC71;
    outline: none;
}

.tool-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ── Buttons (light dark grey) ── */
.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
}
.theme-dark .btn-tool {
    color: #94A3B8;
}

.btn-tool-primary {
    background: #6b7280;
    color: #ffffff;
    border-color: #6b7280;
}
.btn-tool-primary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.btn-tool-secondary {
    background: transparent;
    color: #475569;
    border-color: #E2E8F0;
}
.theme-dark .btn-tool-secondary {
    color: #94A3B8;
    border-color: #334155;
}
.btn-tool-secondary:hover {
    background: #E2E8F0;
    color: #0A192F;
}
.theme-dark .btn-tool-secondary:hover {
    background: #334155;
    color: #F8FAFC;
}

/* ── Output ── */
.tool-output {
    background: #1e1e2e;
    border: 1px solid #2d2d44;
    padding: 1rem;
    overflow: hidden;
    max-height: 200px;
    transition: max-height 0.4s ease;
    font-family: 'Menlo', 'Monaco', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}
.tool-output.expanded {
    max-height: 800px;
}

.toggle-btn {
    display: block;
    text-align: center;
    margin-top: 6px;
    color: #8a8aaa;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
}
.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2.5px solid rgba(46, 204, 113, 0.25);
    border-top-color: #2ECC71;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── FAQ ── */
.faq-section {
    margin-top: 2rem;
    border-top: 1px solid #E2E8F0;
    padding-top: 1.5rem;
}
.theme-dark .faq-section {
    border-top-color: #334155;
}

.faq-item {
    border-bottom: 1px solid #E2E8F0;
    padding: 0.75rem 0;
}
.theme-dark .faq-item {
    border-bottom-color: #334155;
}
.faq-item:last-child { border-bottom: none; }

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #0A192F;
    font-size: 0.95rem;
}
.theme-dark .faq-question {
    color: #F8FAFC;
}
.faq-question:hover { color: #2ECC71; }

.faq-answer {
    display: none;
    padding-top: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}
.theme-dark .faq-answer {
    color: #94A3B8;
}
.faq-answer.open { display: block; }

.faq-icon {
    transition: transform 0.3s ease;
}
.faq-icon.open { transform: rotate(180deg); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .tool-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .tool-header .traffic-lights {
        align-self: flex-start;
    }
    .tool-header .tool-title {
        font-size: 1rem;
    }
    .tool-header .tool-actions {
        justify-content: flex-start;
        margin-top: 4px;
    }
    .btn-tool {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }
    .tool-output {
        max-height: 150px;
        font-size: 0.8rem;
    }
    .tool-output.expanded {
        max-height: 500px;
    }
    .tool-tabs button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}