/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: url('bg.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: #333;
    line-height: 1.2;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphic Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header h1 i {
    margin-right: 12px;
    color: #9f88fb;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.last-update {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.auto-refresh-status {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.refresh-btn,
.mark-all-read-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.refresh-btn:hover,
.mark-all-read-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mark-all-read-btn {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.3);
    margin-right: 10px;
}

.mark-all-read-btn:hover {
    background: rgba(76, 175, 80, 0.3);
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    color: #9f88fb;
    margin-bottom: 15px;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.stat-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}



/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #9f88fb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Feeds Container */
.feeds-container {
    display: grid;
    gap: 20px;
}

.feed-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.feed-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.feed-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Compact Table-like Articles Grid */
.articles-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.75rem;
}

.articles-table tr {
    cursor: pointer;
}

.articles-table th {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.articles-table th:first-child {
    border-top-left-radius: 8px;
}

.articles-table th:last-child {
    border-top-right-radius: 8px;
}

.articles-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
}

.articles-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.articles-table tr:last-child td {
    border-bottom: none;
}

/* Unified Table Column Layout */
.unified-table .article-title-cell {
    width: 60%;
}

.unified-table .article-source-cell {
    width: 25%;
}

.unified-table .article-date-cell {
    width: 15%;
}



/* Individual Feed Table Column Layout (for backward compatibility) */
.articles-table:not(.unified-table) .article-title-cell {
    width: 40%;
}

.articles-table:not(.unified-table) .article-meta-cell {
    width: 25%;
}

.articles-table:not(.unified-table) .article-description-cell {
    width: 25%;
}

.articles-table:not(.unified-table) .article-actions-cell {
    width: 10%;
    text-align: center;
}

/* Article Title Column */
.article-title {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: color 0.3s ease;
}

.article-title:hover {
    color: #9f88fb;
}

/* Article Source Column */
.article-source {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    font-weight: 500;
}

.article-source i {
    color: #9f88fb;
    margin-right: 5px;
}

/* Article Date Column */
.article-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

.article-date i {
    color: #9f88fb;
    margin-right: 5px;
}



/* Article Meta Column (for backward compatibility) */
.article-meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}



/* Article Actions Column */
.article-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Read Status Indicator */
.article-row.read {
    opacity: 0.4;
}

.article-row.read .article-title {
    color: rgba(255, 255, 255, 0.5);
}

.article-row.read .article-source,
.article-row.read .article-date {
    color: rgba(255, 255, 255, 0.3);
}

/* Compact Article Cards (Fallback) */
.articles-grid {
    display: grid;
    gap: 15px;
}

.article-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.article-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.article-card.read {
    opacity: 0.7;
}

.article-card.read::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    background: #4CAF50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.article-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.article-meta span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    max-width: 800px;
    margin: 50px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-body {
    padding: 30px;
}

.article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.article-meta span {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-description {
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.article-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.read-btn,
.bookmark-btn {
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.read-btn {
    background: #667eea;
    color: white;
}

.read-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.bookmark-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid #667eea;
    cursor: pointer;
}

.bookmark-btn:hover {
    background: #667eea;
    color: white;
}

.bookmark-btn.bookmarked {
    background: #ffd700;
    color: #333;
    border-color: #ffd700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header h1 {
        font-size: 2rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }





    .modal-content {
        margin: 20px;
        max-width: none;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    /* Switch to card view on mobile for better UX */
    .articles-table {
        display: none;
    }

    .articles-grid {
        display: grid;
    }


}

@media (max-width: 480px) {
    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 20px;
    }

    .feed-section {
        padding: 20px;
    }

    .article-card {
        padding: 15px;
    }
}