/* ============================================================
   NEWS.CSS - تصميم صفحة الأخبار
   ============================================================ */

/* ====== HERO ====== */
.news-hero {
    padding: 140px 0 60px;
    background: var(--bg-secondary);
    text-align: center;
}

.news-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
}

.news-hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.news-hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ====== FILTERS ====== */
.news-filters {
    padding: 20px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 70px;
    z-index: 39;
    backdrop-filter: blur(20px);
    background: rgba(var(--bg-rgb, 255, 255, 255), 0.90);
}

[data-theme="dark"] .news-filters {
    background: rgba(10, 10, 26, 0.92);
}

.filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tabs button {
    padding: 6px 18px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tabs button:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-tabs button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(108, 60, 225, 0.25);
}

.filter-search input {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    width: 200px;
    transition: all 0.3s ease;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 60, 225, 0.08);
}

/* ====== NEWS GRID ====== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

/* ====== NEWS CARD ====== */
.news-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.4s ease;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.news-card .news-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.news-card .news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.08);
}

.news-card .news-image .news-category {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
}

.news-card .news-image .news-status-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.news-card .news-image .news-date {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(10px);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    color: #fff;
    font-weight: 600;
}

.news-card .news-body {
    padding: 24px;
}

.news-card .news-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.news-card .news-body h3 a {
    transition: var(--transition);
}

.news-card .news-body h3 a:hover {
    color: var(--primary);
}

.news-card .news-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .news-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.news-card .news-footer .news-stats {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.news-card .news-footer .news-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.news-card .news-footer .news-stats span:hover {
    color: var(--primary);
}

.news-card .news-footer .news-stats span.liked {
    color: #E74C3C;
}

.news-card .news-footer .news-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--primary);
    transition: all 0.3s ease;
    font-size: 0.88rem;
}

.news-card .news-footer .news-link:hover {
    gap: 12px;
}

/* ====== NO NEWS ====== */
.no-news {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
    color: var(--text-muted);
}

.no-news i {
    font-size: 4.5rem;
    color: var(--border);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-news h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text);
}

/* ====== LOADING ====== */
.loading-spinner {
    text-align: center;
    padding: 60px 0;
    grid-column: 1 / -1;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-spinner p {
    color: var(--text-muted);
}

/* ====== NEWS DETAIL ====== */
.news-detail {
    padding: 40px 0 60px;
    background: var(--bg);
}

.news-detail .news-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 40px;
}

.news-detail .news-content .news-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.news-detail .news-content .news-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-detail .news-content h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 16px;
}

.news-detail .news-content .news-body-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
}

.news-detail .news-content .news-body-text p {
    margin-bottom: 16px;
}

.news-detail .news-content .news-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.news-detail .news-content .news-actions button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.news-detail .news-content .news-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.news-detail .news-content .news-actions button.liked {
    border-color: #E74C3C;
    color: #E74C3C;
    background: rgba(231, 76, 60, 0.08);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 20px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
    gap: 12px;
}

/* ====== COMMENTS ====== */
.comments-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.comments-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.comment-form input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    min-width: 200px;
}

.comment-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 60, 225, 0.08);
}

.comment-form button {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.comment-form button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item .comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.comment-item .comment-content {
    flex: 1;
}

.comment-item .comment-content .comment-user {
    font-weight: 700;
    font-size: 0.9rem;
}

.comment-item .comment-content .comment-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.comment-item .comment-content .comment-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ====== NEWS STATS BAR ====== */
.news-stats-bar {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.news-stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.news-stats-bar .stat-item i {
    font-size: 1rem;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .news-hero {
        padding: 120px 0 40px;
    }

    .news-hero h1 {
        font-size: 2rem;
    }

    .filter-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        justify-content: center;
        gap: 6px;
    }

    .filter-tabs button {
        padding: 4px 12px;
        font-size: 0.7rem;
    }

    .filter-search input {
        width: 100%;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-card .news-image {
        height: 160px;
    }

    .news-detail .news-content {
        padding: 20px;
    }

    .news-detail .news-content h1 {
        font-size: 1.5rem;
    }

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

    .comment-form input {
        width: 100%;
    }

    .news-stats-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .filter-tabs button {
        font-size: 0.6rem;
        padding: 3px 10px;
    }
}