/* ===================================
   News Page Styles
   Al-Alwi International Schools
   =================================== */

/* Page Hero Section */
.page-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    padding: 100px 0 60px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.page-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 28px;
    border: 2px solid var(--primary-blue);
    background: transparent;
    color: var(--primary-blue);
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* News Card */
.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.news-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.08);
}

/* Category Badge */
.news-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-category.academic {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.news-category.events {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.news-category.announcements {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.news-category.sports {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.news-category.arts {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.news-category.general {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

/* Card Content */
.news-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-date i {
    color: var(--primary-blue);
}

.news-card h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.5;
    font-weight: 700;
}

.news-card p {
    color: #6b7280;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.news-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
}

.news-link:hover {
    gap: 12px;
    color: var(--primary-light);
}

.news-link i {
    transition: transform 0.3s ease;
}

.news-link:hover i {
    transform: translateX(5px);
}

/* Featured Post */
.featured-post {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 50px;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.3);
}

.featured-post-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    min-height: 450px;
}

.featured-image {
    position: relative;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-badge {
    position: absolute;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-blue);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.featured-content {
    padding: 50px 45px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content .news-category {
    position: static;
    display: inline-block;
    width: fit-content;
    margin-bottom: 20px;
}

.featured-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.featured-content p {
    opacity: 0.9;
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.featured-content .news-link {
    color: white;
    border: 2px solid white;
    padding: 12px 28px;
    border-radius: 30px;
    width: fit-content;
    transition: all 0.3s ease;
}

.featured-content .news-link:hover {
    background: white;
    color: var(--primary-blue);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 50px 0;
    flex-wrap: wrap;
}

.page-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover,
.page-btn.active {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

.page-btn.arrow {
    width: auto;
    padding: 0 20px;
}

/* Events Section */
.events-section {
    background: #f8fafc;
    padding: 60px 0;
    margin-top: 40px;
}

.events-header {
    text-align: center;
    margin-bottom: 40px;
}

.events-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.events-header p {
    color: #6b7280;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.event-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    align-items: flex-start;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.event-date-box {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 80px;
    flex-shrink: 0;
}

.event-date-box .day {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    display: block;
}

.event-date-box .month {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
}

.event-details {
    flex: 1;
}

.event-details h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.event-details p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.event-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.event-meta i {
    color: var(--primary-blue);
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    padding: 60px 0;
    text-align: center;
    color: white;
    margin-top: 60px;
}

.newsletter-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.newsletter-section p {
    opacity: 0.9;
    margin-bottom: 30px;
}

.newsletter-form {
    display: flex;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 15px 25px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 15px 35px;
    background: white;
    color: var(--primary-blue);
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

/* Database Error State */
.db-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #991b1b;
    margin: 20px 0;
}

.db-error i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #dc2626;
}

.db-error h3 {
    margin-bottom: 10px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .news-card {
        background: #1e293b;
    }
    
    .news-card h3 {
        color: #f1f5f9;
    }
    
    .news-card p {
        color: #94a3b8;
    }
    
    .news-date {
        color: #94a3b8;
    }
    
    .filter-btn {
        border-color: #475569;
        color: #e2e8f0;
    }
    
    .filter-btn:hover,
    .filter-btn.active {
        background: var(--primary-blue);
        border-color: var(--primary-blue);
        color: white;
    }
    
    .page-btn {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .events-section {
        background: #0f172a;
    }
    
    .event-card {
        background: #1e293b;
    }
    
    .event-details h3 {
        color: #f1f5f9;
    }
    
    .event-details p {
        color: #94a3b8;
    }
    
    .db-error {
        background: #1e1e1e;
        border-color: #441111;
        color: #f87171;
    }
}

/* Body dark mode override */
body.dark-mode .news-card {
    background: #1e293b;
}

body.dark-mode .news-card h3 {
    color: #f1f5f9;
}

body.dark-mode .news-card p,
body.dark-mode .news-date {
    color: #94a3b8;
}

body.dark-mode .filter-btn {
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

body.dark-mode .page-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .events-section {
    background: #0f172a;
}

body.dark-mode .event-card {
    background: #1e293b;
}

body.dark-mode .event-details h3 {
    color: #f1f5f9;
}

body.dark-mode .event-details p {
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 992px) {
    .featured-post-inner {
        grid-template-columns: 1fr;
    }
    
    .featured-image {
        height: 300px;
    }
    
    .featured-content {
        padding: 35px 30px;
    }
    
    .featured-content h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .page-hero {
        padding: 80px 20px 50px;
    }
    
    .page-hero h1 {
        font-size: 2rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-tabs {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .featured-content {
        padding: 30px 25px;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .event-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .event-date-box {
        display: flex;
        gap: 10px;
        justify-content: center;
        align-items: center;
    }
    
    .event-date-box .month {
        margin-top: 0;
    }
    
    .event-meta {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .page-hero h1 {
        font-size: 1.6rem;
    }
    
    .page-hero p {
        font-size: 1rem;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .page-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .newsletter-form input {
        min-width: 100%;
    }
    
    .newsletter-form button {
        width: 100%;
    }
}
