/* News Page Styles */

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.show {
    opacity: 1;
    visibility: visible;
}

.search-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.search-container {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.search-modal.show .search-container {
    transform: scale(1);
}

.search-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-header h3 {
    color: #4B6043;
    margin: 0;
}

.close-search {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.close-search:hover {
    color: #333;
}

.search-form {
    padding: 1.5rem 2rem;
    display: flex;
    gap: 1rem;
}

.search-form input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-form input:focus {
    outline: none;
    border-color: #4B6043;
}

.search-form button {
    padding: 1rem 1.5rem;
    background: #4B6043;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #3d4e37;
}

.search-results {
    padding: 0 2rem 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

/* News Header */
.news-header {
    background: linear-gradient(135deg, #f8faf9, #e8f5f3);
    padding: 3rem 0;
    margin-top: 80px;
    border-bottom: 1px solid #eee;
}

.news-title {
    text-align: center;
    margin-bottom: 2rem;
}

.news-title h1 {
    font-size: 2.8rem;
    color: #4B6043;
    margin-bottom: 1rem;
}

.news-title p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.news-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #4B6043;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* News Content */
.news-content {
    padding: 3rem 0;
}

.news-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3rem;
}

/* Sidebar */
.news-sidebar {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 2rem;
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.sidebar-section h3 {
    color: #4B6043;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-item:hover,
.category-item.active {
    background: #f8faf9;
    border-color: #7EA371;
}

.category-item input {
    display: none;
}

.category-name {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.category-count {
    font-size: 0.8rem;
    color: #999;
    background: #f5f5f5;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.category-item.active .category-count {
    background: #7EA371;
    color: white;
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.popular-post:hover {
    background: #f8faf9;
}

.popular-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.popular-content h4 {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-date {
    font-size: 0.75rem;
    color: #999;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f5f5f5;
    color: #666;
    border-radius: 15px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tag:hover {
    background: #7EA371;
    color: white;
    transform: translateY(-1px);
}

/* News Main */
.news-main {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.news-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.6rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover,
.view-btn.active {
    border-color: #4B6043;
    background: #4B6043;
    color: white;
}

.sort-options select {
    padding: 0.6rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.sort-options select:focus {
    outline: none;
    border-color: #4B6043;
}

.results-info {
    color: #666;
    font-size: 0.9rem;
}

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

.article-card {
    border: 1px solid #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    height: fit-content;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: #7EA371;
}

.article-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

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

.article-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(75, 96, 67, 0.9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-featured,
.article-new {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.article-featured {
    background: #e74c3c;
    color: white;
}

.article-new {
    background: #f39c12;
    color: white;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #999;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.article-tags .tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
}

.read-more {
    color: #4B6043;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: #7EA371;
    transform: translateX(3px);
}

.read-more:after {
    content: '→';
    font-weight: normal;
    transition: transform 0.3s ease;
}

.read-more:hover:after {
    transform: translateX(3px);
}

/* List View */
.articles-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.articles-grid.list-view .article-card {
    display: flex;
    align-items: center;
}

.articles-grid.list-view .article-image {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
}

.articles-grid.list-view .article-content {
    flex: 1;
    padding: 1.5rem;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.load-more-btn {
    background: linear-gradient(45deg, #4B6043, #7EA371);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(75, 96, 67, 0.3);
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.page-btn:hover,
.page-btn.active {
    border-color: #4B6043;
    background: #4B6043;
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #4B6043, #7EA371);
    padding: 3rem 0;
    color: white;
}

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

.newsletter-text h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: white;
}

.newsletter-text p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    width: 100%;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.newsletter-form input:focus {
    outline: none;
}

.newsletter-form button {
    background: #f39c12;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.newsletter-form button:hover {
    background: #e67e22;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .news-layout {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .news-stats {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 25px;
    }

    .news-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .news-sidebar {
        order: 2;
        position: static;
        margin-top: 1rem;
    }

    .news-main {
        order: 1;
    }

    .news-header {
        padding: 2rem 0;
    }

    .news-title h1 {
        font-size: 2.2rem;
    }

    .news-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .news-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

    .articles-grid.list-view .article-card {
        flex-direction: column;
        align-items: stretch;
    }

    .articles-grid.list-view .article-image {
        width: 100%;
        height: 200px;
    }

    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-form {
        max-width: 100%;
    }

    .search-overlay {
        padding: 1rem;
    }

    .search-header,
    .search-form {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .news-header {
        padding: 1.5rem 0;
    }

    .news-title h1 {
        font-size: 1.8rem;
    }

    .news-title p {
        font-size: 1rem;
    }

    .news-content {
        padding: 2rem 0;
    }

    .news-sidebar {
        padding: 1.5rem;
    }

    .news-main {
        padding: 1.5rem;
    }

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

    .article-image {
        height: 200px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        padding: 1rem;
    }

    .search-container {
        max-width: 100%;
        margin: 1rem;
    }

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

    .stat-number {
        font-size: 1.3rem;
    }

    .sidebar-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .popular-posts {
        gap: 0.8rem;
    }

    .popular-post {
        padding: 0.3rem;
    }

    .popular-image {
        width: 50px;
        height: 50px;
    }

    .popular-content h4 {
        font-size: 0.85rem;
    }
}

/* Animation for article cards */
.article-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4B6043;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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