/* --------------------------------- */
/*        استایل کلی صفحه           */
/* --------------------------------- */
.detail-container {
    /* اصلاح مهم: کاهش فاصله زیاد بالا برای حذف فضای خالی زشت */
    padding-top: 10px; 
    padding-right: 50px;
    padding-left: 50px;
    padding-bottom: 50px;
    
    color: white;
    background-color: #001F3F; /* سرمه‌ای */
    min-height: 100vh;
    direction: rtl;
}

/* --- دکمه بازگشت به لیست (بالای صفحه) --- */
.back-btn-container {
    text-align: left;
    margin-bottom: 10px; /* فاصله کمتر با تیتر */
}

.back-btn {
    display: inline-block;
    background-color: #001F3F;
    color: #ffffff;
    border: 2px solid #FFD700;
    padding: 8px 20px; /* کمی جمع‌وجورتر */
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.back-btn:hover {
    background-color: #FFD700; 
    color: #001F3F;
}

/* عنوان پروژه */
.detail-title {
    font-size: 2.2rem;
    color: #FFD700;
    margin-top: 0;       /* حذف فاصله اضافی از بالا */
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #003366;
    padding-bottom: 10px;
}

/* تصویر اصلی در صفحه */
.detail-main {
    width: 100%;
    max-width: 800px;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin: 0 auto 30px auto;
    border-radius: 12px;
    border: 3px solid #FFD700;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* متن توضیحات */
.detail-desc {
    font-size: 1.6rem;
    text-align: justify;
    line-height: 2.4;
    margin-bottom: 50px;
    background: #002A55;
    padding: 30px;
    border-radius: 12px;
    border-right: 5px solid #FFD700;
}

/* --------------------------------- */
/*        استایل گالری تصاویر       */
/* --------------------------------- */
.gallery-section {
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #003366;
    padding-top: 20px;
}

.gallery-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #FFD700;
    display: inline-block;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 8px;
}

.gallery-box {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-box img {
    width: 250px !important;
    height: 170px !important;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #FFD700;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-box img:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
    z-index: 10;
}

/* --------------------------------- */
/*      استایل مودال (پنجره عکس)    */
/* --------------------------------- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 99999 !important; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.96);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.modal-content {
    max-width: 90%;
    max-height: 75vh;
    border: 4px solid #FFD700;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    object-fit: contain;
}

/* دکمه بستن (ضربدر بالا) */
.close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 100000;
}

.close:hover {
    color: #FFD700;
    transform: scale(1.1);
}

/* دکمه بستن پایین تصویر */
.modal-back-btn {
    margin-top: 20px;
    background-color: #001F3F;
    color: #fff;
    border: 2px solid #FFD700;
    padding: 10px 40px;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.modal-back-btn:hover {
    background-color: #FFD700;
    color: #001F3F;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* ریسپانسیو موبایل */
@media only screen and (max-width: 768px) {
    .detail-container {
        padding-top: 130px; /* تنظیم موبایل */
        padding-right: 20px;
        padding-left: 20px;
    }
    .gallery-box img {
        width: 100% !important;
        height: auto !important;
    }
    .modal-content {
        max-width: 95%;
    }
}
