/* ===============================
   RTL FORM FIX (Bootstrap + your UI)
   =============================== */

/* لما الصفحة RTL */
html[dir="rtl"] body.public-page,
body.public-page[dir="rtl"]{
    direction: rtl;
}

/* labels + placeholders + validation */
html[dir="rtl"] .form-label,
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] .invalid-feedback,
html[dir="rtl"] .valid-feedback,
html[dir="rtl"] .text-muted {
    text-align: right;
}

/* spacing في bootstrap input groups / feedback */
html[dir="rtl"] .invalid-feedback,
html[dir="rtl"] .valid-feedback{
    text-align: right;
}

/* لو عندك text-start في success table أو غيره، خليها responsive للـ dir */
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }

/* ===============================
   intl-tel-input RTL FIX
   =============================== */

/* خلي الـ iti ياخد عرض كامل */
html[dir="rtl"] .iti{
    width: 100%;
}

/* مهم: خليك مع allow-dropdown عشان العلم والسهم */
html[dir="rtl"] .iti.iti--allow-dropdown input,
html[dir="rtl"] .iti.iti--separate-dial-code input{
    /* في RTL لازم padding يكون يمين بدل شمال */
    padding-right: 52px !important;
    padding-left: 12px !important;
    text-align: right;
}

/* انقل حاوية العلم/السهم لليمين */
html[dir="rtl"] .iti__flag-container{
    right: 0 !important;
    left: auto !important;
}

/* لو فيه separate dial code */
html[dir="rtl"] .iti__selected-flag{
    padding: 0 10px 0 8px;
}

/* dropdown نفسه */
html[dir="rtl"] .iti__country-list{
    text-align: right;
}

/* خلي البوردر متناسق مع تصميمك */
html[dir="rtl"] .iti__flag-container{
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

html[dir="rtl"] .iti input{
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===============================
   RT HEADER + LANG TOGGLE
   =============================== */

#rt-header{
    width:100%;
    background:transparent;
    backdrop-filter: none;
    border-bottom:none;
    height:78px;
    display:flex;
    align-items:center;
    position:relative;
    z-index:10;
}

#rt-header-wrap{
    width:100%;
    max-width:1200px;
    margin:0 auto;
    padding:0 28px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

#rt-left{
    display:flex;
    align-items:center;
    gap:12px;
    min-width: 0;
}

#rt-ramadan{
    font-size:20px;
    font-weight:700;
    color:#1a2e24;
    letter-spacing:-0.3px;
    white-space:nowrap;
}

#rt-lang{
    display:flex;
    align-items:center;
    gap:8px;
    padding:6px;
    border:1px solid #e2e8f0;
    border-radius:999px;
    background:#fff;
}

.rt-lang-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:30px;
    min-width:40px;
    padding:0 12px;
    border-radius:999px;
    text-decoration:none;
    font-weight:700;
    font-size:12px;
    color:#1a2e24;
    background:transparent;
    border:1px solid transparent;
    transition:all .2s ease;
}

.rt-lang-btn:hover{
    border-color:#e2e8f0;
    background:#f8fafc;
}

.rt-lang-btn.is-active{
    background: rgba(13,107,74,0.10);
    border-color: rgba(13,107,74,0.25);
    color: var(--primary);
}

#rt-right{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    min-width: 0;
}

#rt-logo-link{
    display:flex;
    align-items:center;
    text-decoration:none;
}

#rt-logo-img{
    height:64px;
    max-height:64px;
    width:auto;
    object-fit:contain;
    display:block;
}

#rt-logo-placeholder{
    font-weight:700;
    font-size:16px;
    color:var(--primary);
}

/* Mobile */
@media(max-width:768px){
    #rt-header{ height:68px; }
    #rt-header-wrap{ padding:0 16px; }
    #rt-logo-img{ height:52px; max-height:52px; }
    #rt-ramadan{ font-size:16px; }
    #rt-lang{ padding:5px; }
    .rt-lang-btn{ height:28px; min-width:36px; font-size:11px; padding:0 10px; }
}

/* Public booking - minimal, rounded, modern */
:root {
    --primary: #0d6b4a;
    --primary-light: #0f7d54;
    --dark: #1a2e24;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.1);
    /* Diagonal pattern (cream | terracotta | dark) */
    --pattern-cream: #FBF6E0;
    --pattern-terracotta: #D2795B;
    --pattern-terracotta-mid: #c46a4a;
    --pattern-dark: #3A3A3A;
}

body.public-page,
body {
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    color: #1a1a1a;
    background-color: var(--pattern-cream);
    background-image:
        radial-gradient(140% 120% at -15% 110%, rgba(40, 40, 40, 0.95) 0% 35%, transparent 36%),
        radial-gradient(150% 120% at -5% 105%, rgba(210, 121, 91, 0.95) 0% 48%, transparent 49%),
        radial-gradient(160% 120% at 0% 100%, rgba(245, 230, 190, 0.9) 0% 70%, transparent 71%),
        radial-gradient(1px 1px at 10% 20%, rgba(60, 45, 30, 0.18) 0 100%, transparent 0),
        radial-gradient(1px 1px at 70% 40%, rgba(60, 45, 30, 0.16) 0 100%, transparent 0),
        radial-gradient(1px 1px at 35% 75%, rgba(60, 45, 30, 0.14) 0 100%, transparent 0),
        radial-gradient(1.2px 1.2px at 85% 65%, rgba(60, 45, 30, 0.16) 0 100%, transparent 0),
        radial-gradient(1px 1px at 50% 10%, rgba(60, 45, 30, 0.14) 0 100%, transparent 0);
    background-size: 130% 130%, 135% 135%, 120% 120%, 240px 240px, 260px 260px, 220px 220px, 280px 280px, 260px 260px;
    background-position: 0% 100%, 0% 100%, 0% 100%, 0% 0%, 40% 20%, 15% 60%, 60% 70%, 80% 30%;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, repeat, repeat;
    animation: pattern-float 18s linear infinite;
}
body.public-page {
    position: relative;
}
.public-video-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.public-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.public-video-mobile { display: none; }
body.public-page #rt-header,
body.public-page main {
    position: relative;
    z-index: 1;
}
@media (max-width: 768px) {
    .public-video-desktop { display: none; }
    .public-video-mobile { display: block; }
}
@keyframes pattern-float {
    0% {
        background-position: 0% 100%, 0% 100%, 0% 100%, 0% 0%, 40% 20%, 15% 60%, 60% 70%, 80% 30%;
    }
    50% {
        background-position: 3% 97%, 4% 98%, 2% 99%, 8% 4%, 48% 24%, 23% 66%, 66% 64%, 72% 36%;
    }
    100% {
        background-position: 0% 100%, 0% 100%, 0% 100%, 0% 0%, 40% 20%, 15% 60%, 60% 70%, 80% 30%;
    }
}

/* Form cards stand out on pattern (no blur on header, blur only on cards) */
body.public-page .public-card,
body.public-page .booking-type-card,
body.public-page .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.04);
}
body.public-page .public-card:hover,
body.public-page .booking-type-card:hover {
    box-shadow: var(--shadow-hover), 0 0 0 1px rgba(0,0,0,0.06);
}

.public-header {
    padding: 1rem 0 1.5rem;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.public-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
}

.ramadan-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dark);
}

.logo-img {
    height: 48px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-placeholder {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 576px) {
    .logo-img { height: 40px; }
    .ramadan-text { font-size: 1.25rem; }
}

.public-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: none;
    overflow: hidden;
}

.public-card .card-body { padding: 2rem; }
@media (max-width: 576px) { .public-card .card-body { padding: 1.5rem; } }

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,107,74,0.15);
}

.btn-public {
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-public-primary {
    background: var(--primary);
    border: none;
}
.btn-public-primary:hover { background: var(--primary-light); }

.booking-type-card {
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
}
.booking-type-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Date/session grid - scrollable when many dates */
.date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.6rem;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}
.date-grid::-webkit-scrollbar { width: 6px; }
.date-grid::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.date-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.date-tile {
    min-height: 72px;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    padding: 0.5rem;
}
.date-tile:hover { border-color: var(--primary); background: #f8fffc; }
.date-tile.selected {
    border-color: var(--primary);
    background: rgba(13,107,74,0.08);
    color: var(--primary);
}
.date-tile .date-day { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.date-tile .date-label { font-size: 0.7rem; color: #64748b; margin-top: 0.2rem; }
.date-tile.selected .date-label { color: var(--primary); }

@media (max-width: 576px) {
    .date-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; max-height: 240px; }
    .date-tile { min-height: 64px; }
    .date-tile .date-day { font-size: 1rem; }
    .date-tile .date-label { font-size: 0.65rem; }
}

/* intl-tel-input overrides */
.iti { display: block; width: 100%; }
.iti__flag-container { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border: 1px solid #e2e8f0; border-right: none; }
.iti input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.iti.iti--allow-dropdown input { padding-left: 52px; }

/* Success page */
.min-vh-50 { min-height: 50vh; }
