/* =====================================================================
   Darna | دارنا — صفحة حجوزاتي (المرحلة 3)
   تُحمَّل بعد style.css وتستعمل نفس متغيرات الألوان. خاصة بصفحة bookings.html فقط.
   ===================================================================== */

.my-bookings-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 5% 80px;
}

.bookings-heading h1 {
    margin: 0 0 6px;
    font-size: 32px;
    font-weight: 800;
    color: var(--ink);
}

.bookings-heading h1:focus {
    outline: none;
}

.bookings-count {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
}

.bookings-storage-note {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.bookings-status {
    min-height: 24px;
    margin: 14px 0;
    font-size: 15px;
    font-weight: 700;
    color: #15803d;
}

/* ---------- بطاقة الحجز ---------- */

.booking-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.booking-item {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 220px;
    gap: 22px;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.booking-photo {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.booking-body {
    min-width: 0;
}

.booking-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.booking-number {
    font-size: 13px;
    font-weight: 700;
    color: #1455a0;
}

.booking-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--sand-soft);
    border: 1px solid #ead9bd;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
}

.booking-name {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
}

.booking-place {
    margin: 2px 0 12px;
    font-size: 14px;
    color: var(--muted);
}

.booking-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin: 0;
}

.booking-facts dt {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
}

.booking-facts dd {
    margin: 2px 0 0;
    font-size: 15px;
    color: var(--ink);
}

.booking-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding-inline-start: 22px;
    border-inline-start: 1px solid var(--line);
}

.booking-price {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--navy);
}

.booking-total {
    margin: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 15px;
    color: var(--ink);
}

.booking-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.booking-link,
.booking-delete {
    display: block;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.booking-link {
    background: var(--navy);
    color: #ffffff;
    border: 1px solid var(--navy);
}

.booking-link:hover {
    background: var(--navy-dark);
}

.booking-delete {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.booking-delete:hover {
    color: #dc2626;
    border-color: #dc2626;
}

/* ---------- لا توجد حجوزات ---------- */

.bookings-empty {
    padding: 48px 24px;
    border: 1px dashed var(--line);
    border-radius: 20px;
    background: var(--sand-soft);
    text-align: center;
}

.bookings-empty p {
    margin: 0 0 20px;
    font-size: 17px;
    color: var(--ink);
}

.book-now-btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    background: var(--navy);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.book-now-btn:hover {
    background: var(--navy-dark);
}

/* ---------- الجهاز اللوحي والهاتف ---------- */

@media (max-width: 860px) {

    .booking-item {
        grid-template-columns: 160px minmax(0, 1fr);
    }

    .booking-side {
        grid-column: 1 / -1;
        padding-inline-start: 0;
        border-inline-start: none;
        padding-top: 14px;
        border-top: 1px solid var(--line);
    }

    .booking-actions {
        flex-direction: row;
    }

    .booking-actions > * {
        flex: 1;
    }
}

@media (max-width: 560px) {

    .my-bookings-page {
        padding: 20px 16px 56px;
    }

    .bookings-heading h1 {
        font-size: 26px;
    }

    .booking-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .booking-photo {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 0;
    }
}


/* =====================================================================
   المرحلة 4د: حجوزات الحساب (من قاعدة البيانات) والحجوزات المحلية
   ===================================================================== */

.bookings-section {
    margin-top: 28px;
}

.bookings-section[hidden] {
    display: none;
}

.bookings-section-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
}

.bookings-account-message {
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: var(--sand-soft);
    text-align: center;
}

.bookings-account-message[hidden] {
    display: none;
}

.bookings-account-message p {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
}

.bookings-account-message p:last-child {
    margin-bottom: 0;
}

.booking-list[hidden] {
    display: none;
}

/* حالة الحجز */
.booking-status {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
}

.booking-status[data-status="pending"] {
    background: #fff7e6;
    border-color: #f5d38a;
    color: #8a5a00;
}

.booking-status[data-status="confirmed"] {
    background: #ecfdf3;
    border-color: #a6e9c0;
    color: #166534;
}

.booking-status[data-status="rejected"],
.booking-status[data-status="cancelled"] {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

.booking-item-account.status-cancelled .booking-photo,
.booking-item-account.status-rejected .booking-photo {
    filter: grayscale(0.7);
    opacity: 0.75;
}

/* زر إلغاء الحجز: نفس شكل زر الحذف */
.booking-cancel {
    display: block;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.booking-cancel:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.bookings-modal .modal-error:empty {
    display: none;
}

.bookings-storage-note:empty,
.bookings-status:empty {
    display: none;
}

/* العناصر المخفية تبقى مخفية حتى لو كان لها شكل زر */
.my-bookings-page [hidden] {
    display: none !important;
}

/* غير مسجّل ولا حجوزات: زر "استكشف الإقامات" فقط، بلا إطار ثانٍ */
.bookings-empty.bookings-empty-plain {
    padding: 18px 0 0;
    border: none;
    background: none;
}
