/**
 * TRENJ - Auth & Account Styles
 * تصميم صفحات المصادقة والحساب
 * منسجم مع airbnb-style.css + style.css
 */

/* ========================================
   صفحة تسجيل الدخول
   ======================================== */

.auth-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--background-light, #f7f7f7);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 2.5rem 2rem;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #7C9F35), var(--secondary-color, #5a7a20));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #222);
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    color: var(--text-secondary, #717171);
    font-size: 0.95rem;
}

/* Form Styles */
.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #222);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.auth-form label i {
    color: var(--primary-color, #7C9F35);
    margin-left: 0.3rem;
}

/* Phone Input */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
    background: white;
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary-color, #7C9F35);
    box-shadow: 0 0 0 3px rgba(124, 159, 53, 0.1);
}

.phone-prefix {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 1rem;
    background: #f7f7f7;
    color: var(--text-secondary, #717171);
    font-weight: 600;
    font-size: 0.95rem;
    border-left: 1px solid #ddd;
    white-space: nowrap;
    height: 52px;
}

.flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

.phone-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 1rem;
    font-size: 1.1rem;
    font-family: 'Tajawal', sans-serif;
    direction: ltr;
    text-align: left;
    height: 52px;
    letter-spacing: 1px;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    direction: ltr;
}

.otp-digit {
    width: 60px;
    height: 65px;
    border: 2px solid #ddd;
    border-radius: 12px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Tajawal', monospace;
    outline: none;
    transition: all 0.2s;
    color: var(--text-primary, #222);
}

.otp-digit:focus {
    border-color: var(--primary-color, #7C9F35);
    box-shadow: 0 0 0 3px rgba(124, 159, 53, 0.15);
    transform: scale(1.05);
}

.otp-digit.filled {
    border-color: var(--primary-color, #7C9F35);
    background: rgba(124, 159, 53, 0.05);
}

.otp-digit.error {
    border-color: #e74c3c;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* OTP Info */
.otp-info {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary, #717171);
}

.otp-phone {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #222);
    margin: 0.3rem 0;
    direction: ltr;
    letter-spacing: 1px;
}

/* Dev OTP Display */
.dev-otp-display {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #856404;
}

.dev-otp-display strong {
    font-size: 1.3rem;
    letter-spacing: 4px;
    direction: ltr;
    display: inline-block;
}

/* Buttons */
.btn-auth {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color, #7C9F35), var(--secondary-color, #5a7a20));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 159, 53, 0.3);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color, #7C9F35);
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--secondary-color, #5a7a20);
}

/* Messages */
.auth-message {
    margin-top: 1rem;
}

.msg {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.msg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.msg-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Remember Me */
.remember-group {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary, #717171);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #7C9F35);
}

/* Resend */
.resend-section {
    text-align: center;
    margin-top: 1.2rem;
}

.resend-timer {
    color: var(--text-secondary, #717171);
    font-size: 0.85rem;
}

/* Form Hint */
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary, #999);
    margin-top: 0.3rem;
}

/* Auth Features */
.auth-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.auth-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-secondary, #717171);
    font-size: 0.8rem;
}

.auth-feature i {
    color: var(--primary-color, #7C9F35);
    font-size: 1.2rem;
}

/* ========================================
   Header Auth Button
   ======================================== */

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border: 2px solid #ddd;
    border-radius: 50px;
    background: white;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #222);
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.user-menu-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color, #7C9F35);
}

.user-menu-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #7C9F35), var(--secondary-color, #5a7a20));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.user-menu-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-menu-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Dropdown */
.user-dropdown-wrapper {
    position: relative;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease;
}

.user-dropdown.show {
    display: block;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.dropdown-header strong {
    display: block;
    color: var(--text-primary, #222);
    font-size: 0.95rem;
}

.dropdown-header small {
    color: var(--text-secondary, #717171);
    font-size: 0.8rem;
    direction: ltr;
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    color: var(--text-primary, #222);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: #f7f7f7;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color, #7C9F35);
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 0;
}

.dropdown-item.danger {
    color: #e74c3c;
}

.dropdown-item.danger i {
    color: #e74c3c;
}

/* ========================================
   صفحة حسابي
   ======================================== */

.account-page {
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

.account-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Not-Host Banner */
.not-host-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #fff3e0;
    border-bottom: 2px solid #ffcc02;
    color: #6d4c00;
}

.not-host-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffe0b2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    color: #e65100;
}

.not-host-text {
    flex: 1;
}

.not-host-text strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.not-host-text p {
    font-size: 0.82rem;
    opacity: 0.85;
    margin: 0;
    line-height: 1.5;
}

.not-host-action {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: #e65100;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    white-space: nowrap;
    transition: background 0.2s;
}

.not-host-action:hover {
    background: #bf360c;
}

/* Profile Header */
.profile-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color, #7C9F35), var(--secondary-color, #5a7a20));
    color: white;
}

.profile-top-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-phone {
    font-size: 0.88rem;
    opacity: 0.9;
    direction: ltr;
    text-align: right;
}

.profile-meta-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.8rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.profile-role-badge.role-host,
.profile-role-badge.role-both {
    background: rgba(255, 215, 0, 0.25);
    color: #fff8dc;
}

.profile-since {
    font-size: 0.78rem;
    opacity: 0.75;
}

.profile-host-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: auto;
    padding: 0.3rem 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.2s;
}

.profile-host-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.profile-actions {
    flex-shrink: 0;
    margin-right: auto;
}

.btn-outline-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.2s;
    background: transparent;
}

.btn-outline-danger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* Setup Banner */
.setup-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    color: #856404;
}

.setup-banner i {
    font-size: 1.5rem;
    color: #ffc107;
}

.setup-banner p {
    margin: 0;
    font-size: 0.85rem;
}

/* Tabs */
.account-tabs-wrapper {
    position: relative;
}
.account-tabs-wrapper::before,
.account-tabs-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.account-tabs-wrapper::before {
    right: 0;
    background: linear-gradient(to left, white 30%, transparent);
}
.account-tabs-wrapper::after {
    left: 0;
    background: linear-gradient(to right, white 30%, transparent);
}
.account-tabs-wrapper.can-scroll-start::after { opacity: 1; }
.account-tabs-wrapper.can-scroll-end::before { opacity: 1; }

.account-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    padding: 0 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.account-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Custom scroll indicator */
.tabs-scroll-indicator {
    height: 3px;
    background: #f1f5f9;
    border-radius: 50px;
    margin: 0 2rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}
.tabs-scroll-indicator.visible {
    opacity: 1;
}
.tabs-scroll-thumb {
    height: 100%;
    background: var(--primary-color, #7C9F35);
    border-radius: 50px;
    position: absolute;
    top: 0;
    right: 0;
    min-width: 20px;
    transition: width 0.15s, transform 0.15s;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary, #717171);
    transition: all 0.2s;
    white-space: nowrap;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color, #7C9F35);
}

.tab-btn.active {
    color: var(--primary-color, #7C9F35);
    border-bottom-color: var(--primary-color, #7C9F35);
}

.tab-badge {
    background: var(--primary-color, #7C9F35);
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Profile Form */
.profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-form .form-group {
    margin-bottom: 1.2rem;
}

.profile-form label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #222);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.profile-form label i {
    color: var(--primary-color, #7C9F35);
    margin-left: 0.3rem;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
    border-color: var(--primary-color, #7C9F35);
    box-shadow: 0 0 0 3px rgba(124, 159, 53, 0.1);
}

.input-disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-actions {
    margin-top: 0.5rem;
}

/* Favorites List */
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-row { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; transition: box-shadow 0.2s, opacity 0.35s, transform 0.35s; position: relative; overflow: hidden; }
.fav-row:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.fav-row.removing { opacity: 0; transform: translateX(30px); pointer-events: none; }
.fav-img-link { flex-shrink: 0; display: block; }
.fav-img { width: 110px; height: 88px; object-fit: cover; border-radius: 10px; display: block; }
.fav-info { flex: 1; min-width: 0; }
.fav-name { font-size: 15px; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.fav-location { font-size: 13px; color: #64748b; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-price { font-size: 14px; color: #222; }
.fav-price-per { font-weight: 400; color: #64748b; font-size: 12px; }
.fav-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.fav-unfav-btn { width: 36px; height: 36px; border: none; background: #fff5f5; border-radius: 50%; color: #ef4444; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.2s; }
.fav-unfav-btn:hover { background: #fee2e2; transform: scale(1.12); }
.fav-unfav-btn.removing-anim { animation: favHeartOut 0.38s ease forwards; }
@keyframes favHeartOut { 0% { transform: scale(1); opacity: 1; } 35% { transform: scale(1.4); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }
.fav-view-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; background: #1e293b; color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background 0.2s; white-space: nowrap; }
.fav-view-btn:hover { background: #334155; color: #fff; }
@media (max-width: 480px) { .fav-img { width: 82px; height: 72px; } .fav-name { font-size: 13px; } .fav-view-btn { padding: 6px 10px; font-size: 12px; } }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary, #717171);
}

.empty-state i {
    font-size: 3.5rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-primary, #222);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Bookings List */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    transition: box-shadow 0.2s;
    overflow: hidden;
}

.booking-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* === New 3-Row Layout === */
.bk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
}

/* --- Row 1: Name + Date --- */
.bk-row-1 {
    padding-top: 12px;
    padding-bottom: 8px;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.bk-name {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bk-name a {
    color: #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bk-name a:hover {
    color: var(--primary-color, #7C9F35);
}

.bk-name i {
    color: #94a3b8;
    font-size: 13px;
}

.bk-date {
    flex-shrink: 0;
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.bk-date i {
    color: #94a3b8;
    font-size: 12px;
}

/* --- Row 2: Image + Details --- */
.bk-row-2 {
    padding-top: 10px;
    padding-bottom: 10px;
    align-items: flex-start;
}

.bk-img-link {
    flex-shrink: 0;
    display: block;
    position: relative;
}

.bk-img {
    width: 110px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.bk-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bk-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.bk-detail-row i {
    font-size: 12px;
    width: 16px;
    text-align: center;
    color: #94a3b8;
}

.bk-details-grid {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.bk-details-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* --- Row 3: Status+Price + Actions --- */
.bk-row-3 {
    padding-top: 8px;
    padding-bottom: 10px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.bk-status-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.bk-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color, #7C9F35);
}

.bk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

/* Legacy selectors kept for JS polling compatibility */
.booking-image {
    width: 100px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.booking-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.booking-details {
    flex: 1;
    min-width: 0;
}

.booking-chalet-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.booking-chalet-name a {
    color: var(--text-primary, #222);
    text-decoration: none;
}

.booking-chalet-name a:hover {
    color: var(--primary-color, #7C9F35);
}

.booking-location {
    font-size: 0.8rem;
    color: var(--text-secondary, #717171);
    margin-bottom: 0.3rem;
}

.booking-dates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #717171);
}

.date-separator {
    color: #ddd;
}

.booking-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.booking-price {
    font-weight: 700;
    color: var(--primary-color, #7C9F35);
}

.booking-status {
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-warning { background: #fff3cd; color: #856404; }
.status-success { background: #d4edda; color: #155724; }
.status-danger  { background: #f8d7da; color: #721c24; }
.status-info    { background: #d1ecf1; color: #0c5460; }

.btn-cancel-booking {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid #dc3545;
    border-radius: 50px;
    background: transparent;
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-cancel-booking:hover {
    background: #dc3545;
    color: #fff;
}

/* Bottom Nav Auth Item */
.bottom-nav-item.nav-account-btn .nav-label {
    font-size: 0.7rem;
}

/* ========================================
   Login Modal (for inline login prompt)
   ======================================== */
.login-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.login-modal-overlay.show {
    display: flex;
}

.login-modal {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    animation: fadeInUp 0.3s ease;
}

.login-modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.login-modal-close:hover {
    background: #e0e0e0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .auth-container {
        padding: 1.5rem 1.2rem;
        border-radius: 12px;
    }
    
    .otp-digit {
        width: 50px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .otp-inputs {
        gap: 8px;
    }
    
    .auth-features {
        gap: 1rem;
    }
    
    .auth-feature span {
        font-size: 0.7rem;
    }
    
    .profile-header {
        padding: 1rem 1.2rem;
    }

    .profile-top-row {
        gap: 0.8rem;
    }

    .profile-avatar {
        width: 50px;
        height: 50px;
    }

    .avatar-placeholder {
        font-size: 1.3rem;
    }

    .profile-name {
        font-size: 1.05rem;
    }

    .profile-phone {
        font-size: 0.82rem;
    }

    .profile-meta-row {
        margin-top: 0.6rem;
        gap: 0.5rem;
    }

    .profile-role-badge {
        font-size: 0.72rem;
        padding: 0.2rem 0.6rem;
    }

    .profile-since {
        font-size: 0.72rem;
    }

    .profile-host-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.7rem;
    }

    .logout-text {
        display: none;
    }

    .btn-outline-danger {
        padding: 0.4rem 0.6rem;
        border-width: 1.5px;
        font-size: 0.9rem;
    }

    /* Not-host banner mobile */
    .not-host-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.7rem;
        padding: 1rem;
    }

    .not-host-action {
        width: 100%;
        text-align: center;
        padding: 0.6rem;
    }
    
    .profile-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .account-tabs {
        padding: 0 1rem;
    }
    
    .tabs-scroll-indicator {
        margin: 0 1rem;
    }
    
    .tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    .bk-row {
        gap: 8px;
        padding: 0 10px;
    }
    
    .bk-row-1 {
        padding-top: 10px;
    }
    
    .bk-img {
        width: 82px;
        height: 68px;
    }
    
    .bk-name {
        font-size: 13px;
    }
    
    .bk-row-3 {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .bk-status-price {
        justify-content: center;
    }
    
    .bk-actions {
        justify-content: center;
    }
    
    /* User dropdown on mobile */
    .user-dropdown {
        position: absolute;
        top: calc(100% + 4px);
        bottom: auto;
        left: 0;
        right: auto;
        min-width: 240px;
        max-width: calc(100vw - 1rem);
        z-index: 99999;
    }
    
    .user-menu-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 1rem 0.5rem;
    }
    
    .otp-digit {
        width: 45px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .phone-prefix {
        padding: 0 0.6rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   Favorite Heart Animation (Interactive)
   Bounce + Particles + Ripple + Glow
   مستوحى من زر الخريطة .nav-map-btn
   ======================================== */

/* --- Base transition for both button types --- */
.chalet-favorite,
.favorite-button {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    isolation: isolate;
}

/* --- Favorited state (red filled heart) --- */
.chalet-favorite.favorited {
    background: rgba(255, 56, 92, 0.08) !important;
}

.favorite-button.favorited {
    color: #FF385C !important;
    background: rgba(255, 56, 92, 0.08) !important;
}

.favorite-button.favorited i {
    color: #FF385C;
}

/* --- 1. Bounce IN (إضافة) — مطاطي مثل navIconBounce --- */
.fav-bounce-in {
    animation: favBounceIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes favBounceIn {
    0%   { transform: scale(1); }
    15%  { transform: scale(0.6); }
    40%  { transform: scale(1.35); }
    60%  { transform: scale(0.9); }
    80%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* --- 2. Bounce OUT (إزالة) — ارتداد خفيف --- */
.fav-bounce-out {
    animation: favBounceOut 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes favBounceOut {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.15); }
    60%  { transform: scale(0.85); }
    100% { transform: scale(1); }
}

/* --- 3. Ripple أحمر ينتشر --- */
.fav-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 56, 92, 0.35) 0%, rgba(255, 56, 92, 0) 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: favRippleExpand 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    pointer-events: none;
    z-index: -1;
}

@keyframes favRippleExpand {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    70%  { opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

/* --- 4. Glow — توهج أحمر حول الزر --- */
.fav-glow {
    box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.4) !important;
    animation: favGlowPulse 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

@keyframes favGlowPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.5); }
    40%  { box-shadow: 0 0 12px 6px rgba(255, 56, 92, 0.25); }
    100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
}

/* --- 5. جزيئات القلوب المتطايرة --- */
.fav-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 20;
}

.fav-particle {
    position: absolute;
    font-size: 10px;
    line-height: 1;
    animation: favParticleFly var(--duration, 0.5s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: inherit;
    --tx: 0px;
    --ty: 0px;
}

@keyframes favParticleFly {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(45deg);
        opacity: 0;
    }
}

/* --- 6. Shake (هزة عند طلب تسجيل الدخول) --- */
.fav-shake {
    animation: favShake 0.5s ease !important;
}

@keyframes favShake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-5px); }
    30%      { transform: translateX(5px); }
    45%      { transform: translateX(-4px); }
    60%      { transform: translateX(4px); }
    75%      { transform: translateX(-2px); }
    90%      { transform: translateX(2px); }
}

/* --- Hover hint: القلب يكبر قليلاً --- */
.favorite-button:hover i,
.chalet-favorite:hover {
    transform: scale(1.12);
}

/* --- الأيقون ينبض عند hover على الزر المفضل --- */
.favorite-button.favorited:hover i {
    animation: favHeartbeat 0.8s ease infinite;
}

@keyframes favHeartbeat {
    0%, 100% { transform: scale(1); }
    15%      { transform: scale(1.2); }
    30%      { transform: scale(1); }
    45%      { transform: scale(1.15); }
}
