/* Hreflang & Canonical Tag Generator (prefix hrf-).
   Canonical field -> alternate rows (URL / language / region) -> x-default toggle
   -> validation messages -> return-link reminder -> tabbed output with copy/download. */
.hrf-card { padding: 28px; }
.hrf-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.hrf-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }

.hrf-section { margin-bottom: 20px; }
.hrf-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.hrf-section-head label, .hrf-section-head .hrf-label { font-weight: 700; font-size: .92em; color: #23272f; display: flex; align-items: center; gap: 7px; }
.hrf-section-head i { color: var(--site-light); }
.hrf-help { font-size: .8em; color: #6b7280; margin: 6px 0 0; line-height: 1.5; }

.hrf-field { display: flex; gap: 8px; align-items: center; }
.hrf-field input[type="url"], .hrf-field input[type="text"] { flex: 1; min-width: 0; }
.hrf-card input[type="url"], .hrf-card input[type="text"], .hrf-card select { border: 1px solid #ddd; border-radius: 8px; padding: 9px 12px; font-size: .92em; font-family: inherit; color: #23272f; background: #fff; outline: none; box-sizing: border-box; width: 100%; transition: border-color .15s ease, box-shadow .15s ease; }
.hrf-card input[type="url"] { font-family: "Courier New", monospace; font-size: .88em; }
.hrf-card input:focus, .hrf-card select:focus { border-color: var(--site-light); box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.hrf-card .hrf-bad { border-color: #dc2626 !important; background: #fef2f2; }

.hrf-ghost-btn { background: none; border: 1px solid #ddd; border-radius: 20px; padding: 6px 14px; font-size: .8em; font-weight: 600; color: #374151; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-family: inherit; }
.hrf-ghost-btn:hover { border-color: var(--site-light); color: var(--site-dark); background: #f0fdfa; }
.hrf-ghost-btn:disabled { opacity: .5; cursor: not-allowed; }
.hrf-ghost-btn.hrf-danger:hover { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }

/* Alternate rows */
.hrf-rows-head { display: grid; grid-template-columns: 28px 1fr minmax(300px, 360px) 36px; gap: 10px; padding: 0 2px 6px; font-size: .75em; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 700; }
.hrf-rows-head span:nth-child(3) { text-align: left; }
.hrf-rows { display: flex; flex-direction: column; gap: 8px; }
.hrf-row { display: grid; grid-template-columns: 28px 1fr minmax(300px, 360px) 36px; gap: 10px; align-items: center; background: #f7f8fa; border: 1px solid #eee; border-radius: 10px; padding: 8px; }
.hrf-row-num { width: 24px; height: 24px; border-radius: 50%; background: #0369a1; color: #fff; font-size: .72em; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.hrf-code-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hrf-remove { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; color: #9ca3af; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .95em; }
.hrf-remove:hover { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }
.hrf-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* x-default */
.hrf-toggle { display: flex; align-items: center; gap: 8px; font-size: .9em; font-weight: 700; color: #23272f; cursor: pointer; user-select: none; }
.hrf-toggle input { accent-color: var(--site-dark); width: 16px; height: 16px; cursor: pointer; }
.hrf-xdefault-wrap { margin-top: 10px; }
.hrf-hidden { display: none !important; }

/* Messages */
.hrf-messages { display: flex; flex-direction: column; gap: 6px; }
.hrf-msg { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: .85em; line-height: 1.5; border: 1px solid; }
.hrf-msg i { margin-top: 3px; flex-shrink: 0; }
.hrf-msg-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.hrf-msg-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.hrf-msg-ok { background: var(--site-success-bg); border-color: var(--site-success-border); color: #166534; }

.hrf-reminder { display: flex; gap: 12px; align-items: flex-start; background: #eff6ff; border: 1px solid #bfdbfe; border-left: 4px solid #0369a1; border-radius: 10px; padding: 12px 14px; font-size: .86em; color: #1e3a8a; line-height: 1.55; margin-bottom: 20px; }
.hrf-reminder i { color: #0369a1; margin-top: 3px; flex-shrink: 0; }
.hrf-reminder strong { display: block; margin-bottom: 2px; }

/* Output */
.hrf-output-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.hrf-tabs { display: flex; border: 1px solid #e5e7eb; border-radius: 30px; padding: 4px; background: #f7f8fa; flex-wrap: wrap; }
.hrf-tab { border: none; background: none; padding: 7px 16px; border-radius: 26px; font-weight: 700; font-size: .84em; color: #6b7280; cursor: pointer; display: flex; align-items: center; gap: 7px; font-family: inherit; transition: background .2s ease, color .2s ease; }
.hrf-tab.active { background: var(--site-dark); color: #fff; }
.hrf-out-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hrf-action-btn { background: none; border: 1px solid var(--site-light); border-radius: 20px; padding: 6px 14px; font-size: .8em; font-weight: 600; color: var(--site-dark); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.hrf-action-btn:hover { background: #f0fdfa; }
.hrf-action-btn:disabled { opacity: .5; cursor: not-allowed; }
.hrf-action-btn.hrf-done { background: var(--site-success-bg); border-color: #86efac; color: #166534; }
.hrf-output { width: 100%; min-height: 220px; border: 1px solid #ddd; border-radius: 8px; padding: 14px 16px; font-family: "Courier New", monospace; font-size: .85em; line-height: 1.6; resize: vertical; box-sizing: border-box; outline: none; background: #fafbfc; color: #23272f; white-space: pre; overflow: auto; }
.hrf-out-note { font-size: .8em; color: #6b7280; margin-top: 8px; line-height: 1.5; }
.hrf-summary { margin-top: 10px; font-size: .82em; color: #6b7280; }

@media (max-width: 900px) {
    .hrf-rows-head { display: none; }
    .hrf-row { grid-template-columns: 28px 1fr 36px; }
    .hrf-code-wrap { grid-column: 2 / 3; }
}
@media (max-width: 600px) {
    .hrf-card { padding: 18px; }
    .hrf-title-bar { margin: -18px -18px 18px; }
    .hrf-row { grid-template-columns: 1fr; }
    .hrf-row-num { margin: 0; }
    .hrf-code-wrap { grid-column: auto; grid-template-columns: 1fr; }
    .hrf-remove { width: 100%; }
    .hrf-field { flex-direction: column; align-items: stretch; }
    .hrf-output-head { flex-direction: column; align-items: stretch; }
    .hrf-tabs { justify-content: center; }
    .hrf-output { min-height: 180px; font-size: .78em; }
}
