/* The Search Feed - Unified Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0b0f19, #1e2a38);
    color: #f1f5f9;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header and Navigation */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    text-decoration: none;
}

.logo i {
    font-size: 1.75rem;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-links a:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Filters */
.filters {
    background: rgba(51, 65, 85, 0.3);
    margin: 2rem 0;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.filters-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.3s;
}

.filters-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.filters-title {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1rem;
}

.filters-toggle {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.filters-toggle.expanded {
    transform: rotate(180deg);
}

.filters-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    display: none;
}

.filters-content.expanded {
    display: block;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 600;
    color: #e2e8f0;
    min-width: 80px;
}

/* Form Elements */
select, input {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s;
    min-width: 120px;
}

select:focus, input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-container i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.search-container input {
    width: 100%;
    padding-left: 2.5rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Article Cards */
.article-card {
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: none;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #f1f5f9;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-source {
    font-size: 0.875rem;
    color: #3b82f6;
    font-weight: 500;
}

.article-time {
    font-size: 0.875rem;
    color: #94a3b8;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-cat {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.tag-lang {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

/* Keywords Carousel */
.keywords-carousel-container {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.carousel-title {
    text-align: center;
    color: #3b82f6;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.keywords-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    cursor: grab;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.keywords-carousel:active {
    cursor: grabbing;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.3s ease;
    will-change: transform;
    padding: 0.5rem 0;
}

.keyword-card {
    flex: 0 0 280px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    color: #f1f5f9;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

.keyword-card:hover {
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.keyword-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.keyword-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.keyword-card-description {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Page Headers */
.category-header, .keyword-header {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(51, 65, 85, 0.3);
    margin: 2rem 0;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.category-title, .keyword-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
    text-transform: capitalize;
}

.category-description, .keyword-description {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading and Status */
.loading {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.carousel-loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination button {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #64748b;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin: 0.25rem;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: #64748b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Admin Panel Styles */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.admin-card {
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s;
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.admin-card h3 {
    color: #3b82f6;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.logout-link {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #94a3b8;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Status Messages */
.status {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 0.5rem;
    display: none;
}

.status.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.status.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Form Sections */
.form-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.form-section h3 {
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.5rem;
    color: #f1f5f9;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

/* Feed, Category, and Keyword Items */
.feed-item,
.category-item,
.keyword-item {
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-info,
.category-info,
.keyword-info {
    flex: 1;
}

.feed-name,
.category-name,
.keyword-name {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.feed-url,
.category-slug,
.keyword-slug {
    color: #94a3b8;
    font-size: 0.875rem;
    word-break: break-all;
}

.feed-category {
    display: inline-block;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Error Pages */
.error-container {
    text-align: center;
    background: rgba(51, 65, 85, 0.3);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    max-width: 500px;
    width: 90%;
}

.error-icon {
    font-size: 5rem;
    color: #ef4444;
    margin-bottom: 1.5rem;
}

.error-code {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.error-description {
    color: #94a3b8;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.suggestions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.suggestions h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.suggestion-link {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s;
}

.suggestion-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-image {
        display: block;
    }

    .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group label {
        min-width: auto;
        width: 100%;
    }

    select, .search-container {
        width: 100%;
    }

    .keywords-carousel-container {
        margin: 2rem 0;
        padding: 1rem;
    }

    .carousel-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .keyword-card {
        flex: 0 0 240px;
        padding: 1rem;
    }

    .keyword-card-title {
        font-size: 1rem;
    }

    .error-container {
        padding: 2rem;
    }

    .error-icon {
        font-size: 3.5rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .category-title, .keyword-title {
        font-size: 2rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* About Section */
.about-section {
    background: rgba(51, 65, 85, 0.3);
    margin: 2rem 0;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.about-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.3s;
}

.about-header:hover {
    background: rgba(59, 130, 246, 0.1);
}

.about-title {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1rem;
}

.about-toggle {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.about-toggle.expanded {
    transform: rotate(180deg);
}

.about-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.about-content.expanded {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    max-height: fit-content;
}

/* Support Text */
.support-text {
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 1rem;
    max-width: none;
}

.support-text h1, 
.support-text h2, 
.support-text h3, 
.support-text h4, 
.support-text h5, 
.support-text h6 {
    color: #3b82f6;
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
}

.support-text p {
    margin-bottom: 1rem;
}

.support-text ul, 
.support-text ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.support-text li {
    margin-bottom: 0.5rem;
}

.support-text a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s;
}

.support-text a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.support-text strong {
    color: #f1f5f9;
    font-weight: 600;
}

.support-text code {
    background: rgba(15, 23, 42, 0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #fbbf24;
}

.support-text pre {
    background: rgba(15, 23, 42, 0.7);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.support-text blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #94a3b8;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: 1rem;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}