/**
 * Newtil Sitemap Generator Stylesheet
 * Fully responsive, modern, dark/light theme compatible with Newtil UI
 */

.sitemap-wrapper {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

/* Card Container */
.sitemap-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .sitemap-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

/* Form Styles */
.sitemap-form-group {
    margin-bottom: 1.5rem;
}

.sitemap-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .sitemap-input-wrapper {
        flex-direction: column;
    }
}

.url-input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.url-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.sitemap-url-input {
    width: 100%;
    height: 52px;
    padding: 0 1rem 0 3rem;
    font-size: 1.05rem;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #0f172a);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .sitemap-url-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.sitemap-url-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-generate {
    height: 52px;
    padding: 0 1.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-generate:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-generate:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-generate .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-generate.loading .btn-spinner {
    display: inline-block;
}

.btn-generate.loading .btn-text {
    opacity: 0.85;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Options Toggle & Panel */
.options-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.btn-toggle-options {
    background: transparent;
    border: none;
    color: #6366f1;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-toggle-options:hover {
    background: rgba(99, 102, 241, 0.08);
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.options-panel {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: rgba(241, 245, 249, 0.6);
    border: 1px dashed var(--border-color, #cbd5e1);
    border-radius: 12px;
}

[data-theme="dark"] .options-panel {
    background: rgba(15, 23, 42, 0.6);
    border-color: #334155;
}

.options-panel.hidden {
    display: none;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.option-field label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color, #334155);
    margin-bottom: 0.4rem;
}

[data-theme="dark"] .option-field label {
    color: #cbd5e1;
}

.option-select {
    width: 100%;
    height: 42px;
    padding: 0 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #0f172a);
    font-size: 0.92rem;
    outline: none;
}

[data-theme="dark"] .option-select {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

.option-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.option-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.option-checkbox-row span {
    font-size: 0.9rem;
    color: var(--text-color, #334155);
    cursor: pointer;
}

[data-theme="dark"] .option-checkbox-row span {
    color: #cbd5e1;
}

/* Feature badges row */
.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #f1f5f9);
}

[data-theme="dark"] .feature-pills {
    border-top-color: #334155;
}

.pill-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    background: rgba(241, 245, 249, 0.7);
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
}

[data-theme="dark"] .pill-item {
    background: rgba(51, 65, 85, 0.5);
    color: #94a3b8;
}

/* Progress Section */
.progress-card {
    border-left: 4px solid #6366f1;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #6366f1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.btn-stop-crawl {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-stop-crawl:hover {
    background: #fecaca;
}

[data-theme="dark"] .btn-stop-crawl {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .progress-bar-track {
    background: #334155;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.75rem;
}

.current-url-box {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .current-url-box {
    background: #0f172a;
    border-color: #334155;
}

.log-terminal {
    height: 150px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    overflow-y: auto;
    line-height: 1.5;
}

.log-line {
    margin-bottom: 0.2rem;
    word-break: break-all;
}

.log-time {
    color: #64748b;
    margin-right: 0.4rem;
}

.log-success { color: #34d399; }
.log-info { color: #93c5fd; }
.log-warn { color: #fcd34d; }
.log-error { color: #f87171; }

/* Results Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

[data-theme="dark"] .stat-box {
    background: #0f172a;
    border-color: #334155;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.35rem;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: #6366f1;
}

.stat-val.success { color: #10b981; }
.stat-val.error { color: #ef4444; }

/* Tabs */
.result-tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    margin-bottom: 1.25rem;
}

[data-theme="dark"] .result-tabs-nav {
    border-bottom-color: #334155;
}

.result-tab-btn {
    padding: 0.65rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s;
}

.result-tab-btn:hover {
    color: #6366f1;
}

.result-tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.result-tab-panel {
    display: none;
}

.result-tab-panel.active {
    display: block;
}

/* XML Code Area */
.xml-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #334155);
    transition: all 0.15s ease;
}

.btn-action.primary {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

.btn-action.primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.btn-action:hover:not(.primary) {
    background: rgba(241, 245, 249, 0.8);
    border-color: #94a3b8;
}

[data-theme="dark"] .btn-action:hover:not(.primary) {
    background: #334155;
    border-color: #64748b;
    color: #f8fafc;
}

.xml-textarea {
    width: 100%;
    height: 380px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1rem;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

/* Table Area */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.table-search-input {
    flex: 1;
    max-width: 320px;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #0f172a);
}

[data-theme="dark"] .table-search-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
}

[data-theme="dark"] .table-responsive {
    border-color: #334155;
}

.sitemap-url-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.sitemap-url-table th {
    background: rgba(241, 245, 249, 0.8);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-color, #334155);
    border-bottom: 1px solid var(--border-color, #cbd5e1);
    white-space: nowrap;
}

[data-theme="dark"] .sitemap-url-table th {
    background: #0f172a;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

.sitemap-url-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    vertical-align: middle;
}

[data-theme="dark"] .sitemap-url-table td {
    border-bottom-color: #1e293b;
}

.sitemap-url-table tr:hover {
    background: rgba(248, 250, 252, 0.6);
}

[data-theme="dark"] .sitemap-url-table tr:hover {
    background: rgba(30, 41, 59, 0.5);
}

.table-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.table-link:hover {
    text-decoration: underline;
}

.url-title-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.2rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-depth {
    background: #e0e7ff;
    color: #4338ca;
}

[data-theme="dark"] .badge-depth {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.badge-priority {
    background: #dcfce7;
    color: #15803d;
}

[data-theme="dark"] .badge-priority {
    background: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

.badge-freq {
    background: #fef3c7;
    color: #b45309;
}

[data-theme="dark"] .badge-freq {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
}

/* Robots.txt Guide Box */
.guide-box {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem;
}

[data-theme="dark"] .guide-box {
    background: #0f172a;
    border-color: #334155;
}

.guide-step {
    margin-bottom: 1.5rem;
}

.guide-step-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.code-snippet-wrap {
    position: relative;
    margin-top: 0.5rem;
}

.code-snippet {
    background: #0f172a;
    color: #38bdf8;
    padding: 1rem 3.5rem 1rem 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.88rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.btn-copy-snippet {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-copy-snippet:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* SEO Info Articles (Landing Page Reference Style) */
.seo-article-section {
    margin-top: 3rem;
}

.seo-section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2.5rem;
}

.seo-section-badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.seo-section-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-color, #0f172a);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .seo-section-title {
    color: #f8fafc;
}

.seo-section-desc {
    font-size: 1rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.step-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 1.75rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .step-card {
    background: #1e293b;
    border-color: #334155;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .step-title {
    color: #f8fafc;
}

.step-desc {
    font-size: 0.92rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.feature-box {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 1.5rem;
}

[data-theme="dark"] .feature-box {
    background: #1e293b;
    border-color: #334155;
}

.feature-icon-wrap {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    margin-bottom: 0.4rem;
}

[data-theme="dark"] .feature-title {
    color: #f8fafc;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    line-height: 1.55;
}

/* Comparison Table */
.comparison-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3.5rem;
}

[data-theme="dark"] .comparison-card {
    background: #1e293b;
    border-color: #334155;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.comparison-table th, .comparison-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .comparison-table th,
[data-theme="dark"] .comparison-table td {
    border-bottom-color: #334155;
}

.comparison-table th {
    font-weight: 700;
    color: var(--text-color, #0f172a);
}

[data-theme="dark"] .comparison-table th {
    color: #f8fafc;
}

.comparison-highlight {
    background: rgba(99, 102, 241, 0.05);
    color: #6366f1;
    font-weight: 600;
}

/* Toast */
.nt-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nt-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nt-toast.success { background: #059669; }
.nt-toast.error { background: #dc2626; }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted, #64748b); }
.font-mono { font-family: ui-monospace, monospace; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
