/* =========================
   🌍 TOOL PAGE WRAPPER
========================= */
.tool-wrapper {
    width: 100%;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
}

/* =========================
   🔥 TOOL HEADER
========================= */
.tool-header {
    margin-bottom: 25px;
}

.tool-header h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
}

.tool-header p {
    font-size: 15px;
    color: #6b7280;
    max-width: 600px;
    margin: auto;
}

/* =========================
   📦 TOOL BOX
   Tool plugin manages its own card layout — this is just a wrapper.
========================= */
.tool-box {
    width: 100%;
}

/* =========================
   ⬆️ UPLOAD BOX
========================= */
.upload-box {
    border: 2px dashed #cbd5e1;
    padding: 40px 20px;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    transition: 0.25s;
    color: #374151;
}

.upload-box:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-box.active {
    border-color: #2563eb;
    background: #dbeafe;
}

/* =========================
   🔘 BUTTONS
========================= */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    transition: 0.25s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    border: 2px solid #2563eb;
    color: #2563eb;
    background: transparent;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

/* =========================
   📊 RESULT AREA
========================= */
.tool-result {
    margin-top: 20px;
    padding: 15px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 14px;
}

/* =========================
   ⚠️ ERROR / STATUS
========================= */
.tool-error {
    color: #dc2626;
    margin-top: 10px;
}

.tool-success {
    color: #16a34a;
    margin-top: 10px;
}

/* =========================
   🔗 RELATED TOOLS SECTION
========================= */
.related-tools {
    margin-top: 48px;
    text-align: left;
}

.related-tools h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}

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

/* =========================
   🃏 RELATED TOOL CARD
========================= */
.related-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease;
}

.related-tool-card:hover {
    border-color: var(--icon-color, #2563eb);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* =========================
   🎨 TOOL ICON
========================= */
.tool-card-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--icon-color, #2563eb) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.related-tool-card:hover .tool-card-icon {
    background: color-mix(in srgb, var(--icon-color, #2563eb) 20%, transparent);
}

.tool-card-icon svg,
.tool-card-icon img {
    width: 28px;
    height: 28px;
    display: block;
}

.tool-card-icon--empty {
    background: #f1f5f9;
}

/* =========================
   📝 TOOL CARD INFO
========================= */
.tool-card-info {
    flex: 1;
    min-width: 0;
}

.tool-card-info h3 {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card-info p {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================
   📱 RESPONSIVE
========================= */
@media (max-width: 768px) {

    .tool-wrapper {
        margin: 20px auto;
        padding: 15px;
    }

    .tool-header h1 {
        font-size: 22px;
    }

    .upload-box {
        padding: 25px 15px;
    }

    .related-tools-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tool-card-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .tool-card-icon svg,
    .tool-card-icon img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 400px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   🔝 TOOL HEADER (upgraded)
========================= */
.tool-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 28px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.tool-header-info {
    flex: 1;
    text-align: left;
}

.tool-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* =========================
   🏷️ BADGES
========================= */
.tool-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* =========================
   🔗 SHARE BUTTON
========================= */
.tool-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 5px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    color: #4b5563;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.tool-share-btn:hover {
    border-color: #93c5fd;
    color: #2563eb;
    background: #eff6ff;
}

@media (max-width: 640px) {
    .tool-share-btn {
        margin-left: 0;
    }
}

.tool-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: capitalize;
}

.tool-badge--free {
    background: #dcfce7;
    color: #16a34a;
}

.tool-badge--premium {
    background: #fef9c3;
    color: #b45309;
}

.tool-badge--category {
    background: #eff6ff;
    color: #2563eb;
}

/* =========================
   ⭐ RATING
========================= */
.tool-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.tool-rating-stars {
    font-weight: 600;
    color: #f59e0b;
}

.tool-rating-count {
    color: #9ca3af;
    font-size: 12px;
}

/* =========================
   ✨ FEATURES
========================= */
.tool-features {
    margin-top: 36px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.tool-features h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}

.tool-features-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.tool-features-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.tool-features-list li svg {
    color: #2563eb;
    flex-shrink: 0;
}

/* =========================
   ❓ FAQ
========================= */
.tool-faq {
    margin-top: 36px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.tool-faq h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}

.tool-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================
   📰 RELATED ARTICLES
   Populated by tool.js from data/blogs.json — posts whose
   relatedTool matches this tool's slug/id.
========================= */
.tool-related-articles {
    margin-top: 36px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.tool-related-articles h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}

.tool-related-articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.tool-related-article-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.tool-related-article-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 16px rgba(37, 99, 235, .08);
}

.tool-related-article-cat {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #2563eb;
}

.tool-related-article-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.tool-related-article-meta {
    font-size: 12px;
    color: #9ca3af;
}

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.faq-item--open {
    border-color: #2563eb;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    text-align: left;
}

.faq-question:hover {
    background: #f9fafb;
}

.faq-icon {
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.25s ease;
}

.faq-item--open .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 18px 16px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

/* =========================
   📱 RESPONSIVE
========================= */
@media (max-width: 600px) {
    .tool-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

    .tool-header-top {
        justify-content: center;
    }

    .tool-features-list {
        grid-template-columns: 1fr;
    }
}
