/* ===============================================
   تحسينات صفحة قراءة المحتوى (Post Reading Page)
   =============================================== */

/* 1. تحسين Hero/Header Section */
.video-content {
    animation: fadeInUp 0.5s ease;
    margin-bottom: 40px;
}

.video-content.content {
    background: linear-gradient(135deg, rgba(32, 41, 86, 0.05), rgba(236, 92, 82, 0.05));
    border-radius: 12px;
    padding: 30px;
}

.book-image img {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: block;
    max-width: 100%;
    height: auto;
}

.book-image img:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* 2. تحسين محتوى النص */
.video-content h4 {
    font-size: 28px;
    color: #000;
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.video-content p {
    font-size: 16px;
    color: #717686;
    line-height: 1.8;
    margin-bottom: 20px;
}

.video-content p:first-of-type {
    font-size: 14px;
    color: rgb(var(--main-color));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 3. تحسين منطقة الأزرار */
.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
    align-items: center;
}

.post-actions button,
.post-actions form {
    transition: all 0.3s ease;
}

.post-actions .ant-btn {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.post-actions .ant-btn span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-actions .ant-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.post-actions .main-btn {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-actions .main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.post-actions .youtube-button {
    background: linear-gradient(135deg, #ff0000, #cc0000) !important;
    color: white !important;
    border: none !important;
}

.post-actions .youtube-button:hover {
    background: linear-gradient(135deg, #cc0000, #990000) !important;
}

/* 4. تحسين Modal/نافذة القراءة */
.modal {
    animation: fadeInScale 0.3s ease;
}

.modal-content {
    animation: slideUp 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 50%;
}

.close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.close-btn {
    transition: all 0.3s ease;
    min-width: 120px;
    font-weight: 600;
}

.close-btn:hover {
    background: darkred !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

#bookFrame {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 5. تحسين قسم "شاهد أيضاً" */
.selected-items {
    margin-top: 60px;
    margin-bottom: 40px;
    padding-top: 30px;
    border-top: 2px solid #eeeef0;
}

.selected-items .content h2 {
    color: #000;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    display: inline-block;
    padding-bottom: 15px;
    border-bottom: 3px solid rgb(var(--second-color));
}

/* 6. تحسين الـ Swiper */
.selected-items-slider {
    margin: 40px 0;
    padding: 20px 0;
}

.swiper-slide {
    animation: fadeInUp 0.4s ease backwards;
}

.swiper-slide:nth-child(1) { animation-delay: 0.1s; }
.swiper-slide:nth-child(2) { animation-delay: 0.2s; }
.swiper-slide:nth-child(3) { animation-delay: 0.3s; }
.swiper-slide:nth-child(4) { animation-delay: 0.4s; }
.swiper-slide:nth-child(5) { animation-delay: 0.5s; }

.vertical-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.vertical-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px);
}

.vertical-card .img {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.vertical-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vertical-card:hover img {
    transform: scale(1.08);
}

.vertical-card .hover-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(32, 41, 86, 0.9), transparent);
    color: white;
    padding: 20px 15px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.vertical-card:hover .hover-btn {
    transform: translateY(0);
}

.vertical-card h4 {
    padding: 15px;
    margin: 0;
    font-size: 16px;
    color: #000;
    font-weight: 700;
    line-height: 1.4;
    min-height: 50px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 7. تحسين الـ Quote Section */
.quote-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease;
}

.quote-card .quote-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    line-height: 1.6;
    margin-bottom: 15px;
}

.quote-card .quote-content p {
    font-size: 16px;
    color: #5b606e;
    line-height: 1.8;
}

.big-image-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.big-image {
    width: auto;
    max-width: none;
    height: 230px;
    display: block;
    animation: slideInLeft 0.6s ease;
}

.quote-img-right {
    animation: slideInRight 0.6s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 8. تحسينات Responsive */
@media (max-width: 768px) {
    .video-content {
        margin-bottom: 30px;
    }

    .video-content.content {
        padding: 20px;
    }

    .video-content h4 {
        font-size: 22px;
    }

    .post-actions {
        gap: 8px;
        margin-top: 20px;
    }

    .post-actions .ant-btn {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 14px;
        flex: 1;
        min-width: calc(50% - 4px);
    }

    .post-actions .ant-btn span {
        flex-direction: column;
        font-size: 12px;
    }

    .modal-content {
        max-width: 95%;
        margin: 10% auto;
    }

    #bookFrame {
        height: 400px !important;
    }

    .selected-items .content h2 {
        font-size: 24px;
    }

    .swiper-button-next,
    .swiper-button-prev {
        width: 36px !important;
        height: 36px !important;
    }

    .big-image {
        height: 150px;
    }

    .quote-card .quote-content h2 {
        font-size: 20px;
    }
}

@media (max-width: 425px) {
    .video-content h4 {
        font-size: 18px;
    }

    .video-content p {
        font-size: 14px;
    }

    .post-actions .ant-btn {
        min-width: 100%;
        width: 100%;
    }

    .post-actions {
        gap: 6px;
    }

    .vertical-card h4 {
        padding: 12px;
        font-size: 14px;
        min-height: 40px;
    }

    .quote-card .quote-content h2 {
        font-size: 18px;
    }

    .big-image {
        height: 120px;
    }

    #bookFrame {
        height: 300px !important;
    }
}

/* 9. تحسين للطباعة */
@media print {
    .post-actions,
    .selected-items,
    .selected-items-slider,
    .quote-card,
    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }

    .video-content {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .book-image img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* 10. تحسين الـ Loading State */
.video-content.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 11. تحسين الـ Error State */
.video-content.error {
    border: 2px solid #ff4d4f;
    background-color: rgba(255, 77, 79, 0.05);
    padding: 20px;
    border-radius: 8px;
}

.video-content.error h4 {
    color: #ff4d4f;
}

/* 12. Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .video-content.content {
        background: rgba(255, 255, 255, 0.05);
    }

    .video-content h4 {
        color: #f0f0f0;
    }

    .video-content p {
        color: #d0d0d0;
    }

    .vertical-card {
        background: #2a2a2a;
    }

    .vertical-card h4 {
        color: #f0f0f0;
    }

    .quote-card .quote-content h2 {
        color: #f0f0f0;
    }

    .quote-card .quote-content p {
        color: #d0d0d0;
    }

    .modal-content {
        background: #2a2a2a;
        color: #f0f0f0;
    }

    .close {
        color: #f0f0f0;
    }
}

/* 13. تحسين الـ Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 14. تحسين الـ Link Styles */
.video-content a {
    color: rgb(var(--main-color));
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.video-content a:hover {
    border-bottom-color: rgb(var(--main-color));
    color: rgb(var(--second-color));
}

/* 15. تحسين الـ Performance */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
