/* تنسيقات عامة */
.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

/* شريط التنقل العلوي */
.app-header {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: #4B5563;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #2563EB;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
}

/* بطاقة المقال */
.article-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

/* صورة الغلاف */
.article-cover {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

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

/* رأس المقال */
.article-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.user-avatar {
    position: relative;
    margin-left: 1rem;
}

.user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10B981;
    border-radius: 50%;
    border: 2px solid white;
}

.user-details h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.25rem;
}

.post-time {
    font-size: 0.875rem;
    color: #6B7280;
}

/* إحصائيات المقال */
.article-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6B7280;
    font-size: 0.875rem;
}

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

/* محتوى المقال */
.article-content {
    padding: 2rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.content-wrapper {
    position: relative;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.content-wrapper.expanded {
    max-height: none;
}

.content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, white);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
}

.read-more-btn {
    background: white;
    border: 1px solid #E5E7EB;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #4B5563;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.read-more-btn:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

/* وقت القراءة */
.reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6B7280;
    font-size: 0.875rem;
    margin: 1.5rem 0;
}

/* التصنيفات والوسوم */
.categories-wrapper, .tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.category, .tag {
    background: #F3F4F6;
    color: #4B5563;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.category:hover, .tag:hover {
    background: #E5E7EB;
    color: #1F2937;
}

/* أزرار التفاعل */
.article-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    border-top: 1px solid #E5E7EB;
}

.like-button, .share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.like-button {
    color: #6B7280;
}

.like-button.active {
    color: #EF4444;
}

.like-button:hover {
    background: #F3F4F6;
}

.share-btn {
    background: #F3F4F6;
    color: #4B5563;
    border: none;
}

.share-btn:hover {
    background: #E5E7EB;
}

/* قسم التعليقات */
.comments-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-sort select {
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #E5E7EB;
    color: #4B5563;
    font-size: 0.875rem;
}

/* بطاقة التعليق */
.comment-card {
    background: #F9FAFB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-content {
    color: #4B5563;
    line-height: 1.6;
}

/* نموذج إضافة تعليق */
.add-comment {
    margin-top: 2rem;
}

.add-comment h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    resize: vertical;
    font-size: 0.875rem;
}

.btn-primary {
    background: #2563EB;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1D4ED8;
}

/* مقالات ذات صلة */
.related-articles {
    margin-top: 3rem;
}

.related-articles h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1.5rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card-small {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.article-card-small:hover {
    transform: translateY(-4px);
}

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

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

.article-details {
    padding: 1rem;
}

.article-details h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.5rem;
}

.article-details h3 a {
    color: inherit;
    text-decoration: none;
}

.article-details h3 a:hover {
    color: #2563EB;
}

.article-meta {
    display: flex;
    gap: 1rem;
    color: #6B7280;
    font-size: 0.875rem;
}

/* الوضع الداكن */
@media (prefers-color-scheme: dark) {
    .app-header,
    .article-card,
    .comments-section,
    .article-card-small {
        background: #1F2937;
    }

    .article-header,
    .article-actions,
    .add-comment {
        border-color: #374151;
    }

    .page-title,
    .article-title,
    .user-details h6,
    .section-header h2,
    .add-comment h3,
    .article-details h3 {
        color: #F9FAFB;
    }

    .back-btn,
    .stat-item,
    .reading-time,
    .category,
    .tag,
    .like-button,
    .share-btn,
    .comment-content,
    .article-meta {
        color: #D1D5DB;
    }

    .content-overlay {
        background: linear-gradient(to bottom, transparent, #1F2937);
    }

    .read-more-btn,
    .share-btn {
        background: #374151;
        border-color: #4B5563;
        color: #D1D5DB;
    }

    .read-more-btn:hover,
    .share-btn:hover {
        background: #4B5563;
    }

    .comment-card {
        background: #374151;
    }

    .form-control {
        background: #374151;
        border-color: #4B5563;
        color: #F9FAFB;
    }

    .form-control:focus {
        border-color: #60A5FA;
    }
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .article-cover {
        height: 250px;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-actions {
        padding: 1rem;
    }

    .comments-section {
        padding: 1.5rem;
    }

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