/**
 * AI Tech News RSS Feeds Directory Styles
 */

/* ── Variables ── */
:root {
    --rnf-primary: #6366f1;
    --rnf-primary-dark: #4f46e5;
    --rnf-primary-rgb: 99, 102, 241;
    --rnf-accent: #f59e0b;
    --rnf-radius: 0.75rem;
    --rnf-radius-sm: 0.5rem;
    /* Light mode theme vars (defined here so dark mode can override) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --border-primary: #e5e7eb;
}

[data-theme='dark'] {
    --rnf-primary: #818cf8;
    --rnf-primary-dark: #6366f1;
    --rnf-primary-rgb: 129, 140, 248;
    --rnf-accent: #fbbf24;
    /* Dark mode theme vars */
    --bg-primary: #0f0f17;
    --bg-secondary: #1a1a24;
    --bg-tertiary: #25252f;
    --text-primary: #f9fafb;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --border-primary: #3f3f46;
}

/* ── Hero ── */
.rnf-hero {
    background: linear-gradient(135deg, var(--bg-secondary, #f9fafb) 0%, var(--bg-primary, #fff) 100%);
    padding: 3rem 1rem 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-primary, #e5e7eb);
}

.rnf-hero-content {
    max-width: 640px;
    margin: 0 auto;
}

.rnf-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--rnf-primary);
    color: white;
    border-radius: 50%;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(var(--rnf-primary-rgb), 0.3);
}

.rnf-hero-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 0.625rem;
    line-height: 1.2;
}

.rnf-hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary, #4b5563);
    margin-bottom: 1.75rem;
}

.rnf-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.rnf-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.rnf-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rnf-primary);
}

.rnf-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #4b5563);
}

.rnf-stat-divider {
    width: 1px;
    height: 2rem;
    background: var(--border-primary, #e5e7eb);
}

/* ── Container ── */
.rnf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

/* ── Controls ── */
.rnf-controls {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-primary, #fff);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-primary, #e5e7eb);
    margin-bottom: 2rem;
}

.rnf-search-wrap {
    position: relative;
    margin-bottom: 0.875rem;
}

.rnf-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary, #9ca3af);
    pointer-events: none;
}

.rnf-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    border: 1.5px solid var(--border-primary, #e5e7eb);
    border-radius: var(--rnf-radius);
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.rnf-search-input:focus {
    border-color: var(--rnf-primary);
    box-shadow: 0 0 0 3px rgba(var(--rnf-primary-rgb), 0.12);
    background: var(--bg-primary, #fff);
}

.rnf-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary, #9ca3af);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}

.rnf-search-clear:hover {
    color: var(--text-primary, #111827);
    background: var(--bg-tertiary, #f3f4f6);
}

/* ── Filter Tabs ── */
.rnf-filter-tabs {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.rnf-filter-tab {
    padding: 0.375rem 0.875rem;
    border: 1.5px solid var(--border-primary, #e5e7eb);
    border-radius: 2rem;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #4b5563);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.rnf-filter-tab:hover {
    border-color: var(--rnf-primary);
    color: var(--rnf-primary);
}

.rnf-filter-tab.active {
    background: var(--rnf-primary);
    border-color: var(--rnf-primary);
    color: white;
}

/* ── Section ── */
.rnf-section {
    margin-bottom: 3rem;
}

.rnf-section-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.rnf-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0;
}

.rnf-section-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary, #9ca3af);
    margin: 0;
    flex: 1;
}

.rnf-section-count {
    font-size: 0.75rem;
    color: var(--rnf-primary);
    background: rgba(var(--rnf-primary-rgb), 0.1);
    padding: 0.125rem 0.625rem;
    border-radius: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Cards Grid ── */
.rnf-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ── Card ── */
.rnf-card {
    background: var(--bg-primary, #fff);
    border: 1.5px solid var(--border-primary, #e5e7eb);
    border-radius: var(--rnf-radius);
    padding: 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.rnf-card:hover {
    border-color: var(--rnf-primary);
    box-shadow: 0 4px 16px rgba(var(--rnf-primary-rgb), 0.1);
    transform: translateY(-2px);
}

.rnf-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.rnf-card-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f9fafb);
    border-radius: var(--rnf-radius-sm);
}

.rnf-card-info {
    flex: 1;
    min-width: 0;
}

.rnf-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rnf-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary, #4b5563);
    margin: 0;
    line-height: 1.4;
}

/* ── Tags ── */
.rnf-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.rnf-tag {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--rnf-primary);
    background: rgba(var(--rnf-primary-rgb), 0.08);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(var(--rnf-primary-rgb), 0.2);
}

/* ── Card Actions ── */
.rnf-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rnf-url-row {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.rnf-url-input {
    flex: 1;
    min-width: 0;
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--border-primary, #e5e7eb);
    border-radius: var(--rnf-radius-sm);
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-tertiary, #9ca3af);
    font-size: 0.75rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
}

.rnf-copy-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #f3f4f6);
    border: 1px solid var(--border-primary, #e5e7eb);
    border-radius: var(--rnf-radius-sm);
    cursor: pointer;
    color: var(--text-secondary, #4b5563);
    transition: all 0.15s;
}

.rnf-copy-btn:hover {
    background: var(--rnf-primary);
    border-color: var(--rnf-primary);
    color: white;
}

.rnf-copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.rnf-btn-row {
    display: flex;
    gap: 0.5rem;
}

.rnf-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.75rem;
    border-radius: var(--rnf-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border: 1.5px solid transparent;
}

.rnf-btn-feedly {
    background: #2bb24c;
    color: white;
    border-color: #2bb24c;
}

.rnf-btn-feedly:hover {
    background: #24963f;
    border-color: #24963f;
}

.rnf-btn-rss {
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #4b5563);
    border-color: var(--border-primary, #e5e7eb);
}

.rnf-btn-rss:hover {
    background: var(--rnf-primary);
    color: white;
    border-color: var(--rnf-primary);
}

/* ── No Results ── */
.rnf-no-results {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary, #4b5563);
}

.rnf-no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.rnf-no-results p {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 0.375rem;
}

.rnf-no-results span {
    font-size: 0.875rem;
    color: var(--text-tertiary, #9ca3af);
}

/* ── How To Section ── */
.rnf-howto {
    margin-top: 1rem;
    padding: 2.5rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: var(--rnf-radius);
    border: 1px solid var(--border-primary, #e5e7eb);
}

.rnf-howto h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 1.75rem;
    text-align: center;
}

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

.rnf-howto-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-primary, #fff);
    border-radius: var(--rnf-radius-sm);
    border: 1px solid var(--border-primary, #e5e7eb);
}

.rnf-step-num {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    background: var(--rnf-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

.rnf-step-body h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 0.375rem;
}

.rnf-step-body p {
    font-size: 0.8125rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.5;
    margin: 0;
}

.rnf-howto-cta {
    text-align: center;
}

.rnf-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--rnf-primary);
    color: white;
    border-radius: var(--rnf-radius);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.15s;
}

.rnf-cta-btn:hover {
    background: var(--rnf-primary-dark);
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .rnf-hero-title {
        font-size: 1.5rem;
    }

    .rnf-cards-grid {
        grid-template-columns: 1fr;
    }

    .rnf-filter-tabs {
        gap: 0.25rem;
    }

    .rnf-filter-tab {
        font-size: 0.75rem;
        padding: 0.3rem 0.625rem;
    }

    .rnf-howto {
        padding: 1.5rem;
    }

    .rnf-section-header {
        flex-direction: column;
        gap: 0.375rem;
    }

    .rnf-stat-divider {
        display: none;
    }

    .rnf-hero-stats {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .rnf-btn-row {
        flex-direction: column;
    }

    .rnf-controls {
        top: 0;
    }
}
