/*==========================
      READING PAGE
==========================*/

.reading-window {
    left: 30px;
    top: 170px;
    width: 650px;
    max-height: 75vh;
    overflow-y: auto;
    background: rgba(10, 10, 15, 0.92) !important;
    border: 2px solid #6b5b7a !important;
    box-shadow: 0 0 50px rgba(100, 70, 150, 0.6) !important;
    z-index: 12 !important;
}

.reading-content {
    padding: 18px 20px !important;
    color: #f0e8f0 !important;
    font-size: 13px;
    line-height: 1.6;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.95) !important;
}

/* ----- الأزرار (6 أزرار) ----- */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(180, 160, 200, 0.15);
    padding-bottom: 12px;
}

.cat-btn {
    background: transparent;
    border: 1px solid rgba(180, 160, 200, 0.15);
    color: #b0a8b8;
    padding: 5px 14px;
    font-family: monospace;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s ease;
    white-space: nowrap;
}

.cat-btn:hover {
    background: rgba(120, 90, 160, 0.15);
    color: #e0d8e8;
}

.cat-btn.active {
    background: rgba(120, 90, 160, 0.25);
    border-color: #6b5b7a;
    color: #f0e8f0;
    box-shadow: 0 0 20px rgba(100, 70, 150, 0.2);
}

/* ----- شبكة البطاقات ----- */
.reading-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

.reading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 10px 8px 12px;
    transition: 0.3s ease;
    border: 1px solid transparent;
}

.reading-card:hover {
    background: rgba(120, 90, 160, 0.12);
    border-color: rgba(180, 160, 200, 0.2);
    transform: translateY(-3px);
}

.reading-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(180, 160, 200, 0.1);
    cursor: pointer;
    transition: 0.3s ease;
}

.reading-card img:hover {
    box-shadow: 0 0 25px rgba(100, 70, 150, 0.3);
}

.reading-card .title {
    margin-top: 8px;
    font-size: 12px;
    color: #d0c8d8;
    text-align: center;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.reading-card .comment {
    margin-top: 4px;
    font-size: 10px;
    color: #9a8aaa;
    text-align: center;
    font-style: italic;
    line-height: 1.4;
    padding: 0 4px;
}

/* ----- Lightbox ----- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.lightbox-box {
    position: relative;
    max-width: 85%;
    max-height: 90%;
    background: rgba(20, 15, 30, 0.85);
    padding: 20px 20px 16px;
    border-radius: 12px;
    border: 1px solid rgba(180, 160, 200, 0.15);
    box-shadow: 0 0 60px rgba(100, 70, 150, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.3s ease;
}

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    border: 1px solid rgba(180, 160, 200, 0.1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin-top: 12px;
    font-size: 14px;
    color: #e0d8e8;
    font-style: italic;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    position: absolute;
    top: 6px;
    right: 14px;
    color: #b0a8b8;
    font-size: 24px;
    cursor: pointer;
    transition: 0.3s ease;
    font-family: monospace;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ffffff;
    transform: scale(1.2);
}

/* ----- رابط العودة ----- */
.reading-window .back-home {
    display: inline-block;
    margin-bottom: 12px;
    color: #b8a8c8;
    text-decoration: none;
    font-family: monospace;
    font-size: 12px;
    transition: 0.3s;
    border-bottom: 1px solid transparent;
}

.reading-window .back-home:hover {
    color: #e8d8f0;
    border-bottom-color: #6b5b7a;
    padding-left: 4px;
}

/* ----- سكرول ----- */
.reading-window::-webkit-scrollbar {
    width: 5px;
}

.reading-window::-webkit-scrollbar-thumb {
    background: #6b5b7a;
    border-radius: 10px;
}

.reading-window::-webkit-scrollbar-track {
    background: transparent;
}

/* ----- أنيميشن ----- */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/*==========================
      MOBILE
==========================*/

@media (max-width: 900px) {

    .reading-window {
        left: 15px;
        top: 140px;
        width: 280px;
        max-height: 70vh;
    }

    .reading-content {
        font-size: 11px;
        padding: 12px !important;
    }

    .reading-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cat-btn {
        font-size: 9px;
        padding: 4px 10px;
    }

    .reading-card .title {
        font-size: 10px;
    }

    .reading-card .comment {
        font-size: 9px;
    }

}