/* Wisite Tour Booking - Frontend Styles */
:root {
    --wt-primary:    #2d6a4f;
    --wt-primary-l:  #52b788;
    --wt-accent:     #40916c;
    --wt-danger:     #e63946;
    --wt-warning:    #f4a261;
    --wt-text:       #1a1a2e;
    --wt-muted:      #6c757d;
    --wt-bg:         #f8fdf9;
    --wt-border:     #d4edda;
    --wt-radius:     12px;
    --wt-shadow:     0 4px 20px rgba(0,0,0,.1);
}

/* ─── Tour Cards Grid ─────────────────────────────────────────── */
.wt-tours-container { direction: rtl; }

.wt-tours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.wt-tour-card {
    background: #fff;
    border-radius: var(--wt-radius);
    box-shadow: var(--wt-shadow);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.wt-tour-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.15); }

.wt-tour-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.wt-tour-type {
    position: absolute; top: 12px; right: 12px;
    background: rgba(45,106,79,.9); color: #fff;
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}

.wt-tour-body { padding: 20px; }
.wt-tour-name { margin: 0 0 8px; font-size: 18px; color: var(--wt-text); }
.wt-tour-desc { color: var(--wt-muted); font-size: 14px; margin: 0 0 12px; line-height: 1.5; }

.wt-tour-meta {
    display: flex; gap: 12px; flex-wrap: wrap;
    font-size: 13px; color: var(--wt-muted); margin-bottom: 16px;
}
.wt-price { color: var(--wt-primary); font-weight: 700; font-size: 15px; margin-right: auto; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.wt-btn {
    display: inline-block; padding: 10px 22px; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer; border: none;
    transition: all .2s; text-decoration: none;
}
.wt-btn-primary { background: var(--wt-primary); color: #fff; width: 100%; text-align: center; }
.wt-btn-primary:hover { background: var(--wt-accent); }
.wt-btn-success { background: #52b788; color: #fff; }
.wt-btn-success:hover { background: #40916c; }
.wt-btn-outline { background: transparent; color: var(--wt-primary); border: 2px solid var(--wt-primary); }
.wt-btn-outline:hover { background: var(--wt-bg); }
.wt-btn-sm { padding: 6px 14px; font-size: 13px; }
.wt-btn-block { display: block; width: 100%; text-align: center; margin-top: 12px; }
.wt-btn-danger { background: transparent; color: var(--wt-danger); border: 2px solid var(--wt-danger); }
.wt-btn-danger:hover { background: #ffebee; }

/* ─── Modal ───────────────────────────────────────────────────── */
.wt-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
body.wt-modal-open { overflow: hidden; }

.wt-modal {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 1100px; max-height: 90vh;
    overflow-y: auto; overflow-x: hidden; padding: 30px; position: relative;
    direction: rtl;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.wt-modal-close {
    position: absolute; top: 12px; left: 12px;
    background: #222; color: #fff; border: none; border-radius: 50%;
    width: 34px; height: 34px; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s; z-index: 10; line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    padding: 0 !important;
}
.wt-modal-close:hover { background: #000; }

/* ─── 3-Column Booking Layout ────────────────────────────────── */
.wt-booking-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
}

.wt-booking-col {
    min-width: 0;
}

/* Right column: Tour info */
.wt-booking-info {
    border-left: 1px solid #eee;
    padding-left: 24px;
}
.wt-booking-info h2 {
    margin: 0 0 12px;
    font-size: 22px;
    color: var(--wt-text);
}
.wt-booking-tour-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}
.wt-tour-details-box {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--wt-muted);
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.wt-tour-details-box span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wt-booking-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    max-height: 300px;
    overflow-y: auto;
}

/* Center column: Calendar */
.wt-booking-calendar h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--wt-text);
}

/* Left column: Slots + Form */
.wt-booking-slots-col {
    border-right: 1px solid #eee;
    padding-right: 24px;
}
.wt-booking-slots-col h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--wt-text);
}
.wt-placeholder-text {
    text-align: center;
    color: var(--wt-muted);
    padding: 40px 10px;
    font-size: 14px;
}

/* ─── Calendar ────────────────────────────────────────────────── */
.wt-calendar-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.wt-cal-nav {
    background: #fff; border: 1px solid #ccc; border-radius: 8px;
    padding: 4px 14px; cursor: pointer; font-size: 22px; font-weight: 700;
    color: var(--wt-text); line-height: 1; transition: all .2s;
}
.wt-cal-nav:hover { background: var(--wt-bg); border-color: var(--wt-primary); color: var(--wt-primary); }
#wt-cal-title, #wt-rs-cal-title { font-weight: 700; font-size: 16px; color: var(--wt-text); }

.wt-cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.wt-cal-header {
    text-align: center; font-size: 12px; font-weight: 700;
    color: var(--wt-muted); padding: 6px 0;
}
.wt-cal-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 14px; cursor: default; transition: all .15s;
    color: #ccc;
}
.wt-cal-day.unavailable { color: #ccc; }
.wt-cal-day.available {
    background: #e8f5e9; color: var(--wt-primary); cursor: pointer; font-weight: 600;
    border: 1px solid #c8e6c9;
}
.wt-cal-day.available:hover { background: var(--wt-primary); color: #fff; }
.wt-cal-day.full { background: #fff3e0; color: #e65100; cursor: pointer; font-weight: 600; border: 1px solid #ffe0b2; }
.wt-cal-day.today { box-shadow: inset 0 0 0 2px var(--wt-primary); font-weight: 700; }
.wt-cal-day.selected { background: var(--wt-primary) !important; color: #fff !important; }
.wt-cal-day.past { color: #ddd; }
.wt-cal-loading { padding: 30px; text-align: center; color: var(--wt-muted); }

.wt-cal-legend {
    display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--wt-muted);
}
.wt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; }
.wt-dot.wt-green { background: #52b788; }
.wt-dot.wt-orange { background: #f4a261; }
.wt-dot.wt-red { background: var(--wt-danger); }

/* ─── Slots ───────────────────────────────────────────────────── */
.wt-slots-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    margin-bottom: 15px;
}
.wt-slot {
    border: 2px solid var(--wt-border); border-radius: 10px;
    padding: 12px; text-align: center; cursor: pointer;
    transition: all .2s; background: #fff;
}
.wt-slot:hover:not(.full) { border-color: var(--wt-primary); background: var(--wt-bg); }
.wt-slot.full { opacity: .7; cursor: pointer; border-color: #eee; }
.wt-slot.full:hover { border-color: #e67e22; opacity: 1; }
.wt-slot.selected { border-color: var(--wt-primary); background: var(--wt-bg); box-shadow: 0 0 0 2px var(--wt-primary-l); }
.wt-slot-time { display: block; font-size: 16px; font-weight: 700; color: var(--wt-text); }
.wt-slot-avail { display: block; font-size: 11px; margin-top: 3px; color: var(--wt-muted); }
.wt-no-slots { text-align: center; padding: 30px; color: var(--wt-muted); }

/* ─── Form Overlay (separate step) ───────────────────────────── */
.wt-form-overlay {
    position: absolute; inset: 0;
    background: #fff; border-radius: 16px;
    z-index: 5; display: flex; align-items: flex-start; justify-content: center;
    padding: 30px; overflow-y: auto;
}
.wt-form-overlay-inner {
    width: 100%; max-width: 460px; direction: rtl;
}
.wt-form-overlay-inner h3 {
    margin: 0 0 16px; font-size: 20px; color: var(--wt-text);
}
.wt-form-back {
    background: none; border: none; color: var(--wt-primary); cursor: pointer;
    font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 16px;
    display: inline-flex; align-items: center; gap: 4px;
}
.wt-form-back:hover { text-decoration: underline; }
.wt-layout-hidden { visibility: hidden; }

/* Inline booking mode (not modal) */
.wt-inline-booking {
    direction: rtl;
    position: relative;
    background: #fff;
    border-radius: var(--wt-radius);
    box-shadow: var(--wt-shadow);
    padding: 30px;
    margin: 20px 0;
}
.wt-inline-booking .wt-form-overlay-inline {
    position: relative; inset: auto;
    border-radius: var(--wt-radius);
    margin-top: 20px;
    padding: 0;
    background: var(--wt-bg);
    border: 1px solid var(--wt-border);
}

/* ─── Booking Form ────────────────────────────────────────────── */
.wt-form-group { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.wt-form-group label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--wt-text); }
.wt-form-group input, .wt-form-group textarea, .wt-form-group select {
    padding: 8px 12px; border: 1.5px solid #ddd; border-radius: 8px;
    font-size: 13px; transition: border-color .2s; direction: rtl;
}
.wt-form-group input:focus, .wt-form-group textarea:focus { border-color: var(--wt-primary); outline: none; }

/* People counter */
.wt-counter {
    display: flex; align-items: center; gap: 12px;
    width: fit-content; margin-top: 4px;
}
.wt-qty-btn {
    background: var(--wt-primary); color: #fff; border: none;
    width: 28px; height: 28px; border-radius: 5px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s; line-height: 1;
}
.wt-qty-btn:hover { background: var(--wt-accent); }
#wt-people-count {
    font-size: 18px; font-weight: 700; min-width: 30px; text-align: center;
}

/* Coupon row */
.wt-coupon-row { display: flex; gap: 8px; }
.wt-btn-coupon { background: var(--wt-primary) !important; color: #fff !important; }

/* Summary & Total */
.wt-summary-box {
    background: var(--wt-bg); border: 1px solid var(--wt-border); border-radius: 8px;
    padding: 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.8;
}
.wt-total-line { margin: 8px 0; }
.wt-total {
    display: flex; flex-direction: column; gap: 3px;
    background: var(--wt-bg); border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.wt-total strong { font-size: 16px; color: var(--wt-primary); }
.wt-discount { color: #e63946; }

/* Spinner */
.wt-spinner {
    width: 36px; height: 36px; border: 4px solid #f0f0f0;
    border-top-color: var(--wt-primary); border-radius: 50%;
    animation: wt-spin .8s linear infinite; margin: 0 auto 10px;
}
@keyframes wt-spin { to { transform: rotate(360deg); } }

/* Notices */
.wt-notice { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin: 8px 0; }
.wt-notice.success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.wt-notice.error   { background: #ffebee; color: #b71c1c; border: 1px solid #ffcdd2; }

/* Card style for private/school/my-bookings forms */
.wt-card {
    background: #fff; border-radius: var(--wt-radius);
    box-shadow: var(--wt-shadow); padding: 30px;
    max-width: 600px; direction: rtl;
}
.wt-card h3 { margin: 0 0 8px; color: var(--wt-primary); }
.wt-card p { color: var(--wt-muted); margin: 0 0 20px; }

/* ─── My Bookings ─────────────────────────────────────────────── */
.wt-my-bookings { direction: rtl; }
.wt-my-bookings .wt-card { max-width: 800px; }

.wt-mb-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wt-mb-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    transition: box-shadow .2s;
    flex-wrap: wrap;
    gap: 10px;
}
.wt-mb-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.wt-mb-card.past { opacity: .6; }
.wt-mb-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}
.wt-mb-card-main strong {
    font-size: 15px;
    color: var(--wt-text);
}
.wt-mb-card-main span {
    font-size: 13px;
    color: var(--wt-muted);
}
.wt-mb-card-actions {
    display: flex;
    gap: 8px;
}

/* Badges (shared) */
.wt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.wt-badge.wt-green  { background: #e8f5e9; color: #2e7d32; }
.wt-badge.wt-red    { background: #ffebee; color: #c62828; }
.wt-badge.wt-yellow { background: #fff8e1; color: #f57f17; }
.wt-badge.wt-gray   { background: #f5f5f5; color: #616161; }
.wt-badge.wt-blue   { background: #e3f2fd; color: #1565c0; }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .wt-booking-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .wt-booking-info {
        border-left: none;
        padding-left: 0;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }
    .wt-booking-slots-col {
        border-right: none;
        padding-right: 0;
    }
    .wt-modal { max-width: 95vw; padding: 20px; }
}

@media (max-width: 600px) {
    .wt-tours-grid { grid-template-columns: 1fr; }
    .wt-modal { padding: 16px; max-height: 95vh; }
    .wt-booking-layout { gap: 16px; }
    .wt-slots-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .wt-mb-card { flex-direction: column; align-items: flex-start; }
    .wt-mb-card-actions { width: 100%; }
    .wt-form-overlay { padding: 20px; }
    .wt-form-overlay-inner { max-width: 100%; }
}
