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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.header-container i {
    margin-right: 1rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

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

.loading-text h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 300;
}

.loading-text p {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.small-text {
    font-size: 0.9rem !important;
    font-style: italic;
    opacity: 0.8;
}

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

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.news-article {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-article:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.article-summary {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.article-category {
    background: #3498db;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-time {
    color: #999;
    font-size: 0.85rem;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.error-message {
    text-align: center;
    color: #e74c3c;
}

.error-message h2 {
    margin-bottom: 1rem;
}

/* News controls styling */
.news-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.generate-new-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.generate-new-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

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

.cache-status {
    font-size: 0.9rem;
    font-style: italic;
    padding: 0.5rem;
    border-radius: 4px;
}

.cache-status.cached {
    color: #27ae60;
    background: #d5f4e6;
}

.cache-status.fresh {
    color: #e67e22;
    background: #fef9e7;
}

/* Read more button styling */
.read-more {
    margin-top: 1rem;
    text-align: right;
}

.read-more-text {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.news-article:hover .read-more-text {
    color: #2980b9;
}

/* Header navigation */
.header-nav {
    margin-top: 1rem;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.3s ease;
}

.back-link:hover {
    opacity: 0.8;
}

.back-link i {
    margin-right: 0.5rem;
}

/* Full article container */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    min-height: 80vh;
}

.full-article {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

/* Article header */
.article-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}

.article-category-badge {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.article-main-title {
    font-size: 2.2rem;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-meta-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: #666;
    font-size: 0.95rem;
}

.article-author {
    font-weight: 500;
}

/* Hero image */
.article-hero-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
}

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

/* Article content */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 3rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.article-content blockquote {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.article-content strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Images gallery */
.article-images-gallery {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.article-images-gallery h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: translateY(-5px);
}

.gallery-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .header-container h1 {
        font-size: 2rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news-container {
        padding: 1rem;
    }
    
    .loading-container {
        padding: 1rem;
    }
    
    /* Mobile styles for full articles */
    .article-container {
        padding: 1rem;
    }
    
    .article-main-title {
        font-size: 1.8rem;
    }
    
    .article-hero-image {
        height: 250px;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile controls */
    .news-controls {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .generate-new-btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .cache-status {
        font-size: 0.8rem;
        text-align: center;
    }
}