:root {
    /* Serene theme variables */
    --bg-color: #f7f9fc;
    --card-bg: #ffffff;
    --text-color: #2d3748;
    --secondary-text: #4a5568;
    --tertiary-text: #718096;
    --border-color: #e2e8f0;
    --accent-color: #4299e1;
    --accent-light: #ebf8ff;
    --header-bg: #ffffff;
    --tab-active-bg: #ebf8ff;
    --tab-active-color: #3182ce;
    --shadow: rgba(0, 0, 0, 0.05);
    --source-bg: #f0f4f8;
    --source-color: #4a5568;
    --source-hover-bg: #4299e1;
    --source-hover-color: white;
}

.theme-dark {
    /* Dark serene theme variables */
    --bg-color: #1a202c;
    --card-bg: #2d3748;
    --text-color: #f7fafc;
    --secondary-text: #e2e8f0;
    --tertiary-text: #cbd5e0;
    --border-color: #4a5568;
    --accent-color: #63b3ed;
    --accent-light: #2c5282;
    --header-bg: #2d3748;
    --tab-active-bg: #2c5282;
    --tab-active-color: #63b3ed;
    --shadow: rgba(0, 0, 0, 0.2);
    --source-bg: #3d465a;
    --source-color: #e2e8f0;
    --source-hover-bg: #63b3ed;
    --source-hover-color: #f7fafc;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header styles */
.app-header {
    background-color: var(--header-bg);
    padding: 24px 32px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    max-width: 1700px;
    margin: 0 auto 20px;
}

.header-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background-color: var(--accent-light);
    transform: scale(1.05);
    color: var(--accent-color);
}

.theme-dark .icon-button:hover {
    background-color: var(--accent-light);
}

.category-tabs {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    max-width: 1700px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: var(--source-bg);
}

.theme-dark .tab {
    background-color: var(--source-bg);
}

.tab.active {
    background-color: var(--tab-active-bg);
    color: var(--tab-active-color);
}

/* Main content area */
main {
    max-width: 1700px;
    margin: 0 auto;
    padding: 40px 50px;
}

/* Category sections */
.category-section {
    margin-bottom: 48px;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

/* Article cards */
.article-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: none;
}

.article-card:hover {
    transform: none;
    box-shadow: 0 4px 12px var(--shadow);
}

.article-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.article-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    z-index: 1;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}

.article-card:hover .article-image img {
    transform: none;
}

/* Bookmark button on image */
.image-bookmark-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    border: none;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.image-bookmark-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.image-bookmark-button.active svg path {
    fill: var(--accent-color);
    stroke: var(--accent-color);
}

.article-content {
    padding: 26px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.4;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

/* Modified article-description with improved styling */
.article-description {
    color: var(--secondary-text);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    margin-bottom: 24px;
    flex: 1;
    max-height: 190px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    line-height: 1.6;
    padding-right: 5px;
}

.article-description p {
    margin-bottom: 14px;
}

/* Style links within article descriptions */
.article-description a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.article-description a:hover {
    text-decoration: underline;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.article-description::-webkit-scrollbar {
    display: none;
}

/* Sources section styling - enhanced */
.article-sources {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sources-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tertiary-text);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: var(--source-color);
    text-decoration: none;
    background-color: var(--source-bg);
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
}

.source-link:before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: var(--accent-color);
    border-radius: 50%;
    margin-right: 6px;
}

.source-link:hover {
    background-color: var(--source-hover-bg);
    color: var(--source-hover-color);
    transform: translateY(-2px);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 30px;
    color: var(--secondary-text);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 12px;
}

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

/* Date display styles - WhatsApp style */
.date-display-container {
    text-align: center;
    position: relative;
    height: 0;
    z-index: 10;
}

.date-display {
    display: inline-block;
    background-color: var(--accent-light);
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 16px;
    box-shadow: 0 2px 6px var(--shadow);
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.date-display.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.theme-dark .date-display {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

/* Large screens */
@media (min-width: 1440px) {
    .article-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 15px;
    }
    
    .category-tabs {
        padding-bottom: 16px;
    }
}

/* Medium screens */
@media (max-width: 1439px) and (min-width: 1201px) {
    .article-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    main {
        padding: 30px 40px;
    }
}

/* Medium-small screens */
@media (max-width: 1200px) {
    .article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .app-header {
        padding: 20px 24px 0;
    }
    
    .header-title {
        font-size: 30px;
    }
    
    main {
        padding: 24px 24px;
    }
}

@media (max-width: 768px) {
    .article-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-section {
        margin-bottom: 30px;
    }
    
    .category-title {
        margin-bottom: 15px;
    }
} 