/* ==========================================================================
   /tools/ — SEO tools styles. Built on the global dubaiseo.ai design tokens
   (see /assets/css/style.css :root). Scoped so it never affects other pages.
   ========================================================================== */

/* 5-column footer used only on /tools/ pages */
@media (min-width: 993px) {
    .footer-grid-tools {
        grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
        gap: 48px;
    }
}

/* Showcase grid ------------------------------------------------------------ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 34px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 40px var(--shadow-lg);
    border-color: var(--primary-light);
}
.tool-card .tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    margin-bottom: 20px;
}
.tool-card .tool-icon svg { width: 28px; height: 28px; color: #fff; }
.tool-card h3 { font-size: 1.25rem; color: var(--text-dark); margin-bottom: 10px; }
.tool-card p { color: var(--text-body); font-size: 0.96rem; line-height: 1.6; margin: 0 0 20px; }
.tool-card .tool-cta {
    margin-top: auto;
    font-weight: 600;
    color: var(--primary-light);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tool-card:hover .tool-cta { color: var(--primary); }

/* Tool application shell --------------------------------------------------- */
.tool-app {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 34px;
    box-shadow: 0 4px 20px var(--shadow);
}
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-field { margin-bottom: 20px; }
.tool-field:last-child { margin-bottom: 0; }
.tool-field label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.94rem;
}
.tool-field .hint { font-weight: 400; color: var(--text-muted); font-size: 0.85rem; }
.tool-input, .tool-textarea, .tool-select {
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.98rem;
    color: var(--text-dark);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tool-input:focus, .tool-textarea:focus, .tool-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(8, 131, 149, 0.12);
    background: #fff;
}
.tool-textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
textarea.code-out {
    font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    min-height: 220px;
    white-space: pre;
    color: #0b3a4a;
}
.counter-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; font-size: 0.82rem; color: var(--text-muted); }
.counter-row b { color: var(--text-dark); font-weight: 600; }
.counter-row .warn { color: #b8962f; font-weight: 600; }
.counter-row .over { color: #c0392b; font-weight: 700; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn-copy {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary);
    color: #fff; border: none; cursor: pointer;
    font-family: var(--font-main); font-weight: 600; font-size: 0.95rem;
    padding: 12px 22px; border-radius: 10px;
    transition: background 0.2s ease, transform 0.15s ease;
}
.btn-copy:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-copy svg { width: 16px; height: 16px; }
.btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; color: var(--primary);
    border: 1px solid var(--border); cursor: pointer;
    font-family: var(--font-main); font-weight: 600; font-size: 0.95rem;
    padding: 12px 22px; border-radius: 10px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.btn-ghost:hover { border-color: var(--primary-light); color: var(--primary-dark); }
.copied-flash { color: #0a7d3d; font-weight: 600; font-size: 0.9rem; align-self: center; opacity: 0; transition: opacity 0.2s ease; }
.copied-flash.show { opacity: 1; }

/* Checkbox / radio pills */
.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.9rem; color: var(--text-body); cursor: pointer; user-select: none;
    transition: all 0.15s ease; background: var(--bg-light);
}
.pill input { accent-color: var(--primary); }
.pill:hover { border-color: var(--primary-light); }

/* Repeatable rows (hreflang) */
.repeat-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; margin-bottom: 10px; align-items: center; }
.repeat-row .btn-remove {
    background: #fdecec; color: #c0392b; border: none; cursor: pointer;
    width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem; line-height: 1;
}
.repeat-row .btn-remove:hover { background: #f9d6d6; }
@media (max-width: 560px) { .repeat-row { grid-template-columns: 1fr 1fr auto; } }

/* SERP snippet preview ----------------------------------------------------- */
.serp-preview { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.serp-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.serp-tab {
    padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-light); cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text-body);
}
.serp-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.serp-result { font-family: Arial, sans-serif; max-width: 600px; }
.serp-result .s-url { color: #202124; font-size: 14px; line-height: 20px; display:flex; align-items:center; gap:8px; }
.serp-result .s-url .s-fav { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; display:inline-flex; align-items:center; justify-content:center; }
.serp-result .s-url .s-fav svg { width: 14px; height: 14px; color: var(--primary); }
.serp-result .s-path { color: #4d5156; font-size: 12px; line-height: 18px; }
.serp-result .s-title { color: #1a0dab; font-size: 20px; line-height: 26px; margin: 4px 0 3px; font-weight: 400; }
.serp-result .s-desc { color: #4d5156; font-size: 14px; line-height: 22px; }
.serp-preview.mobile { max-width: 400px; }
.serp-preview.mobile .serp-result { max-width: 360px; }
.serp-preview.mobile .s-title { font-size: 18px; line-height: 24px; }

/* Info / how-to blocks ----------------------------------------------------- */
.tool-note {
    background: var(--bg-alt);
    border-left: 4px solid var(--primary-light);
    border-radius: 8px;
    padding: 18px 22px;
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.65;
}
.tool-note strong { color: var(--text-dark); }
.howto-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.howto-list li { display: flex; gap: 14px; align-items: flex-start; }
.howto-list .num {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; font-weight: 700; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
}
.howto-list li p { margin: 0; color: var(--text-body); line-height: 1.55; }
.howto-list li b { color: var(--text-dark); }

/* Related tools strip ------------------------------------------------------ */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.related-tools a {
    display: flex; gap: 12px; align-items: center;
    background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px; text-decoration: none; color: var(--text-dark); font-weight: 600;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.related-tools a:hover { border-color: var(--primary-light); transform: translateY(-3px); }
.related-tools .r-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; }
.related-tools .r-ico svg { width: 20px; height: 20px; color: var(--primary); }

.privacy-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: #e8f5ee; color: #0a7d3d; border-radius: 999px;
    padding: 7px 16px; font-size: 0.85rem; font-weight: 600; margin-top: 16px;
}
.privacy-badge svg { width: 15px; height: 15px; }

/* ===== RTL overrides for /ar/tools/ (only apply on dir=rtl pages) ===== */
[dir="rtl"] .tool-note { border-left: 0; border-right: 4px solid var(--primary-light); }
[dir="rtl"] .counter-row { direction: rtl; }
[dir="rtl"] textarea.code-out,
[dir="rtl"] #sg-out,
[dir="rtl"] .serp-result { direction: ltr; text-align: left; }
[dir="rtl"] .serp-preview { text-align: left; }
