/* ==========================================================================
   Robots.txt Generator - rtg-style.css
   Prefix: rtg-
   ========================================================================== */

.rtg-wrap *,
.rtg-wrap *::before,
.rtg-wrap *::after {
    box-sizing: border-box;
}

.rtg-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

.rtg-main-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.rtg-main-subtitle {
    font-size: 0.92rem;
    color: #6b7280;
    margin: 0 0 26px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.rtg-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .rtg-layout { grid-template-columns: 1fr; }
    .rtg-right { order: -1; }
    .rtg-left  { order: 1; }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.rtg-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.rtg-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

.rtg-section-note {
    font-size: 0.82rem;
    color: #6b7280;
    margin: -6px 0 14px;
}

.rtg-section-note code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #e53935;
}

/* --------------------------------------------------------------------------
   Presets
   -------------------------------------------------------------------------- */
.rtg-presets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rtg-preset-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.rtg-preset-option:hover {
    border-color: #93c5fd;
    background: #f8faff;
}

.rtg-preset-selected,
.rtg-preset-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.rtg-preset-option input[type="radio"] {
    margin-top: 3px;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.rtg-preset-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rtg-preset-label strong {
    font-size: 0.9rem;
    color: #111827;
}

.rtg-preset-label small {
    font-size: 0.78rem;
    color: #6b7280;
}

/* --------------------------------------------------------------------------
   Global fields
   -------------------------------------------------------------------------- */
.rtg-field {
    margin-bottom: 16px;
}

.rtg-field:last-child { margin-bottom: 0; }

.rtg-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    margin-bottom: 5px;
}

.rtg-muted { color: #9ca3af; font-weight: 400; text-transform: none; letter-spacing: 0; }

.rtg-field input[type="url"],
.rtg-field input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fafafa;
    color: #1f2937;
    transition: border-color 0.2s;
}

.rtg-field input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.rtg-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   User-agent rule blocks
   -------------------------------------------------------------------------- */
.rtg-rule-block {
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    margin-bottom: 14px;
    overflow: hidden;
}

.rtg-rule-block:last-child { margin-bottom: 0; }

.rtg-rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f8fafc;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    user-select: none;
}

.rtg-rule-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.rtg-rule-agent-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    white-space: nowrap;
}

.rtg-rule-agent-select {
    flex: 1;
    padding: 5px 8px;
    font-size: 0.88rem;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #1f2937;
    min-width: 0;
    max-width: 200px;
}

.rtg-rule-agent-custom {
    flex: 1;
    padding: 5px 8px;
    font-size: 0.88rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #1f2937;
    min-width: 0;
    display: none;
}

.rtg-rule-agent-select:focus,
.rtg-rule-agent-custom:focus {
    outline: none;
    border-color: #2563eb;
}

.rtg-rule-delete-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.rtg-rule-delete-btn:hover { color: #e53935; background: #fef2f2; }

.rtg-rule-body {
    padding: 14px;
}

/* path rows inside a rule */
.rtg-path-section {
    margin-bottom: 12px;
}

.rtg-path-section:last-child { margin-bottom: 0; }

.rtg-path-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.rtg-path-section-label.rtg-label-disallow { color: #dc2626; }
.rtg-path-section-label.rtg-label-allow    { color: #16a34a; }
.rtg-path-section-label.rtg-label-delay    { color: #d97706; }

.rtg-paths-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 6px;
}

.rtg-path-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rtg-path-input {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fafafa;
    color: #1f2937;
    transition: border-color 0.2s;
}

.rtg-path-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
}

.rtg-path-remove {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.rtg-path-remove:hover { color: #e53935; }

.rtg-add-path-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s;
}
.rtg-add-path-btn:hover { color: #1d4ed8; text-decoration: underline; }

/* crawl-delay row */
.rtg-crawl-delay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.rtg-crawl-delay-row label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #d97706;
    white-space: nowrap;
}

.rtg-crawl-delay-input {
    width: 70px;
    padding: 5px 8px;
    font-size: 0.85rem;
    font-family: monospace;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fafafa;
    color: #1f2937;
}
.rtg-crawl-delay-input:focus {
    outline: none;
    border-color: #d97706;
}

.rtg-crawl-delay-unit {
    font-size: 0.78rem;
    color: #9ca3af;
}

/* --------------------------------------------------------------------------
   Add rule button
   -------------------------------------------------------------------------- */
.rtg-add-rule-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px solid #bfdbfe;
    border-radius: 7px;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s;
}
.rtg-add-rule-btn:hover { background: #dbeafe; }

/* --------------------------------------------------------------------------
   Action buttons
   -------------------------------------------------------------------------- */
.rtg-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rtg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rtg-btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.rtg-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.rtg-btn-outline { background: transparent; color: #2563eb; border-color: #2563eb; }
.rtg-btn-outline:hover { background: #eff6ff; }

.rtg-btn-ghost { background: transparent; color: #6b7280; border-color: #e5e7eb; }
.rtg-btn-ghost:hover { background: #f9fafb; }

/* --------------------------------------------------------------------------
   Output panel
   -------------------------------------------------------------------------- */
.rtg-output-card { position: relative; }

.rtg-output-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.rtg-output-header .rtg-card-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.rtg-output-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rtg-output-actions .rtg-btn { padding: 6px 14px; font-size: 0.8rem; }

.rtg-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.rtg-placeholder-icon {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.rtg-placeholder p { font-size: 0.9rem; margin: 0; }

.rtg-output {
    background: #0f172a;
    border-radius: 8px;
    padding: 18px 20px;
    overflow-x: auto;
    max-height: 560px;
    overflow-y: auto;
    margin: 14px 0 0;
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.83rem;
    line-height: 1.75;
    color: #e2e8f0;
    white-space: pre;
}

/* syntax colours */
.rtg-tok-comment  { color: #64748b; font-style: italic; }
.rtg-tok-key      { color: #93c5fd; }
.rtg-tok-disallow { color: #fca5a5; }
.rtg-tok-allow    { color: #86efac; }
.rtg-tok-sitemap  { color: #fcd34d; }
.rtg-tok-delay    { color: #fdba74; }
.rtg-tok-blank    { display: block; height: 0.5em; }

/* --------------------------------------------------------------------------
   How to deploy
   -------------------------------------------------------------------------- */
.rtg-how-card { background: #f8faff; }

.rtg-how-list {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.9;
}

.rtg-how-list code {
    background: #e0e7ff;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.82em;
    color: #3730a3;
}

.rtg-how-note {
    font-size: 0.82rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 12px 0 0;
}

/* -----------------------