@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.chat-container {
    max-width: 600px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
    overflow: hidden;
}

/* Header - Apple Frosted Glass Style */
.chat-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(var(--primary-color-rgb, 0, 122, 255), 1);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Glossy shine overlay */
/* Ensure header content is above the shine */
.chat-logo,
.chat-header-info,
.manage-booking-btn {
    position: relative;
    z-index: 1;
}
/* Header scrolled state - transparent glass */
.chat-header.scrolled {
    background: rgba(var(--primary-color-rgb, 0, 122, 255), 0.5);
    transition: background 0.3s ease;
}

.chat-header {
    transition: background 0.3s ease;
}


/* Glossy shine overlay */
/* Ensure header content is above the shine */
.chat-logo,
.chat-header-info,
.manage-booking-btn {
    position: relative;
    z-index: 1;
}

/* Optional: Extra glossy shine layer */
.chat-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Reservation Banner */
.reservation-banner {
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: rgba(245, 245, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e5ea;
    padding: 12px 20px;
    z-index: 99;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.reservation-banner.visible {
    display: flex;
}

.reservation-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
}

.reservation-banner-content svg {
    color: var(--primary-color, #007AFF);
    flex-shrink: 0;
}

.reservation-text {
    flex: 1;
}

.reservation-timer {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color, #007AFF);
    background: rgba(0,122,255,0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

.reservation-hint {
    font-size: 12px;
    color: #86868b;
    padding-left: 26px;
}

/* Messages Area */
.chat-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 100px 20px 80px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: messageSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.owner {
    justify-content: flex-start;
}

.message.client {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-bubble strong {
    font-weight: 700;
}

.message.owner .message-bubble {
    background: var(--bubble-owner, #E5E5EA);
    color: var(--bubble-text-owner, #1d1d1f);
    border-bottom-left-radius: 6px;
}

.message.client .message-bubble {
    background: var(--bubble-client, #007AFF);
    color: var(--bubble-text-client, #ffffff);
    border-bottom-right-radius: 6px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: var(--bubble-owner, #E5E5EA);
    border-radius: 20px;
    border-bottom-left-radius: 6px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #86868b;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.chat-button {
    background: white;
    border: 2px solid var(--primary-color, #007AFF);
    color: var(--primary-color, #007AFF);
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-button:hover {
    background: var(--primary-color, #007AFF);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.chat-button.selected {
    background: var(--primary-color, #007AFF);
    color: white;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.chat-button svg {
    flex-shrink: 0;
}

/* Slot Accept/Reject Buttons */
.slot-accept-btn {
    border-color: #34c759 !important;
    color: #34c759 !important;
}

.slot-accept-btn:hover {
    background: #34c759 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.slot-reject-btn {
    border-color: #ff3b30 !important;
    color: #ff3b30 !important;
}

.slot-reject-btn:hover {
    background: #ff3b30 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

/* Time Grid */
.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}

.time-button {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    min-height: 56px;
    text-align: center;
    overflow: visible;
}

.time-button .time-value {
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 3;
}

/* Recommended Slot - Use ::before for background */
.time-button.recommended {
    transform: scale(1.05);
    border-width: 2px;
    border-color: var(--recommended-border, var(--primary-color, #007AFF)) !important;
    box-shadow: 
        0 0 0 2px var(--recommended-border, var(--primary-color, #007AFF)), 
        0 4px 12px var(--recommended-glow, rgba(0, 122, 255, 0.3)) !important;
}

/* Background layer - BEHIND the text */
.time-button.recommended::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--recommended-bg, rgba(0, 122, 255, 0.1));
    border-radius: 12px;
    z-index: 1;
    pointer-events: none;
}

/* EXPLICIT text color - MUST be visible */
.time-button.recommended {
    color: var(--recommended-border, var(--primary-color, #007AFF)) !important;
}

.time-button.recommended .time-value {
    color: var(--recommended-border, var(--primary-color, #007AFF)) !important;
}

/* Hover state */
.time-button.recommended:hover::before {
    background: var(--primary-color, #007AFF);
}

.time-button.recommended:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 4px 12px var(--recommended-glow, rgba(0, 122, 255, 0.3)) !important;
}

.time-button.recommended:hover,
.time-button.recommended:hover .time-value {
    color: white !important;
}

/* Recommended Badge */
.recommended-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.recommended-badge.star {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #FFD60A 0%, #FF9F0A 100%);
    border-radius: 50%;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 159, 10, 0.5);
    border: 2px solid white;
}

.recommended-badge.star svg {
    width: 14px;
    height: 14px;
}

.recommended-badge.text {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    letter-spacing: 0.3px;
}

/* Service Buttons */
.service-button {
    position: relative;
    padding-left: 50px;
}

.service-checkbox {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary-color, #007AFF);
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.service-button.selected .service-checkbox {
    background: var(--primary-color, #007AFF);
}

.service-checkbox svg {
    width: 14px;
    height: 14px;
    stroke: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.service-button.selected .service-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.service-name { font-weight: 600; }
.service-details { font-size: 13px; opacity: 0.75; }

/* Confirm Button */
.confirm-selection {
    background: var(--primary-color, #007AFF);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
    font-family: inherit;
}

.confirm-selection:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,122,255,0.4);
}

/* Chat Input Area */
.chat-input {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #e5e5ea;
    z-index: 98;
}

.chat-input:empty {
    display: none;
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e5ea;
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    background: #fafafa;
    -webkit-appearance: none;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color, #007AFF);
    background: white;
    box-shadow: 0 0 0 4px rgba(0,122,255,0.1);
}

.notes-input {
    resize: none;
    min-height: 60px;
}

.notes-actions {
    display: flex;
    gap: 10px;
}

.btn-skip {
    flex: 1;
    background: #f5f5f7;
    border: none;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #86868b;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-skip:hover {
    background: #e5e5ea;
}

.submit-button {
    flex: 2;
    background: var(--primary-color, #007AFF);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
    font-family: inherit;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,122,255,0.4);
}

/* Loyalty Card */
.loyalty-card {
    border-radius: 18px;
    padding: 0;
    margin-top: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
}

.loyalty-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.loyalty-card-content {
    position: relative;
    z-index: 1;
    padding: 24px;
}

.loyalty-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.loyalty-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.loyalty-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}

.loyalty-qr {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.loyalty-client-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.loyalty-points {
    font-size: 16px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.loyalty-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.loyalty-btn {
    flex: 1;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: inherit;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.loyalty-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Chat Footer */
.chat-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(245, 245, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    padding: 12px 20px;
    border-top: 1px solid #e5e5ea;
    z-index: 97;
}

.chat-footer a {
    color: #86868b;
    text-decoration: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.chat-footer a:hover {
    color: var(--primary-color, #007AFF);
}

/* Loading */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Add to Home Screen Modal */
.ath-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: athFadeIn 0.3s ease;
}

.ath-modal.closing {
    animation: athFadeOut 0.3s ease forwards;
}

@keyframes athFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes athFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.ath-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ath-modal-content {
    position: relative;
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    padding-bottom: env(safe-area-inset-bottom);
    animation: athSlideUp 0.3s ease;
}

.ath-modal.closing .ath-modal-content {
    animation: athSlideDown 0.3s ease forwards;
}

@keyframes athSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes athSlideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.ath-modal-header {
    text-align: center;
    padding: 28px 24px 20px;
    border-bottom: 1px solid #e5e5ea;
}

.ath-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary-color, #007AFF) 0%, #5856d6 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(0,122,255,0.3);
}

.ath-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1d1d1f;
}

.ath-modal-header p {
    font-size: 15px;
    color: #86868b;
}

.ath-modal-body {
    padding: 20px 24px;
}

.ath-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f7;
}

.ath-step:last-child {
    border-bottom: none;
}

.ath-step-num {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color, #007AFF) 0%, #5856d6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

.ath-step-text {
    font-size: 15px;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ath-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f5f5f7;
    border-radius: 6px;
    color: var(--primary-color, #007AFF);
}

.ath-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ath-btn-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color, #007AFF) 0%, #5856d6 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,122,255,0.3);
    transition: all 0.2s;
}

.ath-btn-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,122,255,0.4);
}

.ath-btn-close {
    padding: 14px 24px;
    background: #f5f5f7;
    color: #86868b;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.ath-btn-close:hover {
    background: #e5e5ea;
}

/* Responsive */
@media (min-width: 768px) {
    body {
        padding: 24px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
    }
    
    .chat-container {
        border-radius: 24px;
        box-shadow: 0 12px 48px rgba(0,0,0,0.25);
        overflow: hidden;
        max-height: calc(100vh - 48px);
        height: calc(100vh - 48px);
    }
    
    .chat-header {
        border-radius: 24px 24px 0 0;
    }
    
    .chat-footer {
        border-radius: 0 0 24px 24px;
    }
    
    .time-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .ath-modal {
        align-items: center;
    }
    
    .ath-modal-content {
        border-radius: 20px;
        max-height: 90vh;
    }
}

@media (max-width: 400px) {
    .time-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iOS Safe Area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .chat-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    .chat-input {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* OTP Input Styles */
.otp-form {
    text-align: center;
}

.otp-input-container {
    margin-bottom: 16px;
}

.otp-input {
    text-align: center;
    font-size: 32px !important;
    font-weight: 700;
    letter-spacing: 12px;
    padding: 16px 20px !important;
    font-family: 'SF Mono', 'Menlo', monospace;
}

.otp-input::placeholder {
    letter-spacing: 12px;
    color: #d2d2d7;
}

.otp-input.error {
    border-color: #ff3b30;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.otp-resend {
    margin-top: 16px;
    font-size: 14px;
    color: #86868b;
}

.resend-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.resend-button {
    background: none;
    border: none;
    color: var(--primary-color, #007AFF);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
    font-family: inherit;
}

.resend-button:hover {
    background: rgba(0, 122, 255, 0.1);
}

.resend-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resend-button .loading {
    width: 14px;
    height: 14px;
    border-width: 2px;
    border-color: rgba(0, 122, 255, 0.2);
    border-top-color: var(--primary-color, #007AFF);
}

/* ============================================
   MANAGE BOOKING STYLES
   ============================================ */

/* Header Button */
.manage-booking-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-left: auto;
}

.manage-booking-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.manage-booking-btn svg {
    flex-shrink: 0;
}

@media (max-width: 400px) {
    .manage-booking-btn span {
        display: none;
    }
    
    .manage-booking-btn {
        padding: 8px;
    }
}

/* Booking Card in Chat */
.booking-card-chat {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(88, 86, 214, 0.08) 100%);
    border-radius: 16px;
    padding: 16px;
    margin-top: 12px;
    border: 1px solid rgba(0, 122, 255, 0.15);
}

.booking-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.booking-card-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-color, #007AFF);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.booking-card-info {
    flex: 1;
    min-width: 0;
}

.booking-card-date {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.booking-card-time {
    font-size: 14px;
    color: #86868b;
}

.booking-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 122, 255, 0.1);
}

.booking-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1d1d1f;
}

.booking-detail-row svg {
    color: #86868b;
    flex-shrink: 0;
}

.booking-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.booking-card-actions .chat-button {
    flex: 1;
    justify-content: center;
}

.booking-card-actions .btn-change {
    border-color: var(--primary-color, #007AFF);
}

.booking-card-actions .btn-cancel {
    border-color: #ff3b30;
    color: #ff3b30;
}

.booking-card-actions .btn-cancel:hover {
    background: #ff3b30;
    color: white;
}

/* Booking Number Badge */
.booking-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color, #007AFF);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Booking List Item */
.booking-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 122, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}

.booking-list-item:hover {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.2);
}

.booking-list-item:last-child {
    margin-bottom: 0;
}

.booking-list-info {
    flex: 1;
    min-width: 0;
}

.booking-list-date {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.booking-list-services {
    font-size: 13px;
    color: #86868b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-list-arrow {
    color: #86868b;
    flex-shrink: 0;
}

/* Cannot Cancel Warning */
.cannot-cancel-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 149, 0, 0.1);
    border-radius: 12px;
    margin-top: 12px;
    font-size: 14px;
    color: #b45309;
}

.cannot-cancel-warning svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================
   BRANDING OVERRIDES (Owner Text Color)
   ============================================ */

/* Typing Dots */
.typing-indicator span {
    background: var(--bubble-text-owner, #1d1d1f);
}

/* Booking List Item - List of reservations */
.booking-list-item {
    border: 1px solid var(--bubble-text-owner, #1d1d1f);
    color: var(--bubble-text-owner, #1d1d1f);
}

.booking-list-date, 
.booking-list-services {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}

.booking-list-arrow {
    color: var(--bubble-text-owner, #1d1d1f) !important;
    opacity: 0.7;
}

/* Current Reservation Card - Text Colors */
.booking-card-date, 
.booking-card-time {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}

.booking-detail-row {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}

.booking-detail-row svg {
    color: var(--bubble-text-owner, #1d1d1f) !important;
    opacity: 0.8;
}

/* Cannot Cancel Warning - Branding Override */
.cannot-cancel-warning {
    color: var(--bubble-text-owner, #b45309) !important;
}

.cannot-cancel-warning svg {
    color: var(--bubble-text-owner, #b45309) !important;
}
/* ============================================
   BOOKING CARD ACTIONS - MOBILE FIX
   ============================================ */

/* Make buttons stack vertically on small screens */
@media (max-width: 480px) {
    .booking-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .booking-card-actions .chat-button {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Ensure booking card fits within bubble */
.booking-card-chat {
    max-width: 100%;
    box-sizing: border-box;
}

/* Reduce padding on very small screens */
@media (max-width: 360px) {
    .booking-card-chat {
        padding: 12px;
    }
    
    .booking-card-header {
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .booking-card-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
    
    .booking-card-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .booking-card-date {
        font-size: 14px;
    }
    
    .booking-card-time {
        font-size: 13px;
    }
    
    .booking-card-actions .chat-button {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 10px;
    }
    
    .booking-card-actions .chat-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Compact button text on smallest screens */
@media (max-width: 320px) {
    .booking-card-actions {
        gap: 6px;
    }
    
    .booking-card-actions .chat-button {
        padding: 10px;
        gap: 6px;
    }
}

/* Change Indicator */
.change-indicator { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; background: rgba(255, 149, 0, 0.1); border-radius: 12px; margin: 12px 0; }
.change-indicator .old-time { text-decoration: line-through; color: #ff3b30; font-size: 14px; }
.change-indicator svg { color: var(--text-secondary); flex-shrink: 0; }
.change-indicator .new-time { font-weight: 600; color: #34c759; font-size: 14px; }
.booking-card-actions .btn-confirm { border-color: #34c759 !important; color: #34c759 !important; }
.booking-card-actions .btn-confirm:hover { background: #34c759 !important; color: white !important; }


/* PISHAJMI CHANGE COLOR OVERRIDE */
.change-indicator .old-time {
    color: var(--bubble-text-owner, #1d1d1f) !important;
    opacity: 0.75 !important;
    text-decoration: line-through !important;
}

.change-indicator .new-time {
    color: var(--bubble-text-owner, #1d1d1f) !important;
    opacity: 1 !important;
    font-weight: 600 !important;
}

.change-indicator svg {
    color: var(--bubble-text-owner, #1d1d1f) !important;
    opacity: 0.7 !important;
}

.booking-card-date {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}

/* Cancel state inside booking card */
.booking-card-chat .booking-card-date,
.booking-card-chat .booking-card-time,
.booking-card-chat .booking-detail-row,
.booking-card-chat .booking-detail-row span,
.booking-card-chat .booking-detail-row svg {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}

/* If cancelled title is rendered inline, keep text readable */
.booking-card-chat [style*="color: var(--bubble-text-owner"] {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}

/* Optional: keep the warning card consistent too */
.cannot-cancel-warning {
    color: var(--bubble-text-owner, #1d1d1f) !important;
}
.cannot-cancel-warning svg {
    color: var(--bubble-text-owner, #1d1d1f) !important;
    opacity: 0.8 !important;
}


/* ============================================
   LANGUAGE SELECTOR
   ============================================ */

.language-btn {
    background: rgba(255, 255, 255, 0.15);
    margin-left: auto;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.language-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.language-option {
    background: white;
    border: 2px solid var(--primary-color, #007AFF);
    color: var(--primary-color, #007AFF);
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-family: inherit;
}

.language-option:hover {
    background: var(--primary-color, #007AFF);
    color: white;
    transform: translateY(-1px);
}

.language-option.active {
    background: var(--primary-color, #007AFF);
    color: white;
    box-shadow: 0 4px 12px rgba(0,122,255,0.25);
}

.language-code {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.7;
    text-transform: uppercase;
}

@media (max-width: 400px) {
    .language-btn span {
        display: none;
    }
    
    .language-btn {
        padding: 8px;
    }
}
/* Service Image in Chat */
.service-button.has-image {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.service-button.has-image .service-image-preview {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.service-button.has-image .service-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-button.has-image:hover .service-image-preview img {
    transform: scale(1.05);
}

.service-button.has-image .service-image-preview .more-images {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

.service-button.has-image .service-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    transform: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.service-button.has-image .service-info {
    padding: 14px 16px;
}

.service-button.has-image.selected {
    box-shadow: 0 0 0 3px var(--primary-color, #007AFF);
}

.service-button.has-image.selected .service-checkbox {
    background: var(--primary-color, #007AFF);
}

/* Grid layout for services with images */
.button-group:has(.service-button.has-image) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.button-group:has(.service-button.has-image) .confirm-selection {
    grid-column: 1 / -1;
}

/* Mobile adjustments */
@media (max-width: 400px) {
    .button-group:has(.service-button.has-image) {
        grid-template-columns: 1fr;
    }
    
    .service-button.has-image .service-image-preview {
        height: 100px;
    }
}
/* ============================================
   SERVICE IMAGE GALLERY MODAL
   ============================================ */

/* Prevent context menu and selection on service images */
.service-button.has-image,
.service-button.has-image * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.service-button.has-image img {
    pointer-events: none;
}

.service-gallery-modal,
.service-gallery-modal * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.service-gallery-slide img {
    pointer-events: none;
}

/* Rounded borders for service thumbnails */
.service-button.has-image .service-image-preview {
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.service-button.has-image .service-image-preview img {
    border-radius: 0;
}

/* Long press indicator */
.service-button.long-pressing {
    transform: scale(0.97);
    transition: transform 0.15s ease;
}

.service-button.long-pressing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: inherit;
    pointer-events: none;
}

/* Service Gallery Modal */
.service-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.service-gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.service-gallery-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.service-gallery-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    margin: 20px;
    background: var(--surface, #ffffff);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.service-gallery-modal.active .service-gallery-content {
    transform: scale(1) translateY(0);
}

/* Gallery Header */
.service-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(var(--primary-color-rgb, 0, 122, 255), 0.05);
    flex-shrink: 0;
}

.service-gallery-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-color, #007AFF);
}

.service-gallery-title svg {
    color: inherit;
}

.service-gallery-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bubble-text-owner, #1d1d1f);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.service-gallery-close:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
}

.service-gallery-close:active {
    transform: scale(0.95);
}

/* Gallery Slider */
.service-gallery-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #f5f5f7;
    overflow: hidden;
    flex-shrink: 0;
}

.service-gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: pan-y pinch-zoom;
}

.service-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.service-gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Navigation Arrows */
.service-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #007AFF);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
}

.service-gallery-slider:hover .service-gallery-nav,
.service-gallery-nav.visible {
    opacity: 1;
    visibility: visible;
}

.service-gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.service-gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.service-gallery-nav.prev {
    left: 12px;
}

.service-gallery-nav.next {
    right: 12px;
}

.service-gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Bottom section - compact container */
.service-gallery-bottom {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Dots Indicator */
.service-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    background: transparent;
    flex-shrink: 0;
}

.service-gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(var(--primary-color-rgb, 0, 122, 255), 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-gallery-dot.active {
    background: var(--primary-color, #007AFF);
    transform: scale(1.2);
}

.service-gallery-dot:hover:not(.active) {
    background: rgba(var(--primary-color-rgb, 0, 122, 255), 0.5);
}

/* Service Info in Modal */
.service-gallery-info {
    padding: 6px 20px 8px;
    flex-shrink: 0;
}

.service-gallery-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--bubble-text-owner, #1d1d1f);
    margin-bottom: 2px;
}

.service-gallery-details {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--bubble-text-owner, #86868b);
    font-size: 14px;
}

.service-gallery-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

.service-gallery-detail svg {
    opacity: 0.7;
}

/* Select Button in Modal */
.service-gallery-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 40px);
    margin: 0 20px 14px;
    padding: 13px 24px;
    background: var(--primary-color, #007AFF);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(var(--primary-color-rgb, 0, 122, 255), 0.35);
    font-family: inherit;
    flex-shrink: 0;
}

.service-gallery-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb, 0, 122, 255), 0.45);
}

.service-gallery-select:active {
    transform: scale(0.98);
}

.service-gallery-select.selected {
    background: #34c759;
    box-shadow: 0 4px 14px rgba(52, 199, 89, 0.35);
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .service-gallery-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .service-gallery-slider {
        aspect-ratio: 1/1;
    }
    
    .service-gallery-nav {
        width: 36px;
        height: 36px;
        opacity: 1;
        visibility: visible;
    }
    
    .service-gallery-nav.prev {
        left: 8px;
    }
    
    .service-gallery-nav.next {
        right: 8px;
    }
    
    .service-gallery-header {
        padding: 12px 16px;
    }
    
    .service-gallery-title {
        font-size: 16px;
    }
    
    .service-gallery-dots {
        padding: 6px 0;
    }
    
    .service-gallery-info {
        padding: 4px 16px 6px;
    }
    
    .service-gallery-name {
        font-size: 16px;
    }
    
    .service-gallery-details {
        font-size: 13px;
    }
    
    .service-gallery-select {
        width: calc(100% - 32px);
        margin: 0 16px 12px;
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Swipe hint animation */
@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

.service-gallery-track.hint {
    animation: swipeHint 0.6s ease;
}

/* No images fallback */
.service-gallery-no-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--bubble-text-owner, #86868b);
    gap: 12px;
}

.service-gallery-no-images svg {
    opacity: 0.4;
}

/* View gallery hint on thumbnail */
.service-image-preview .view-gallery-hint {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.service-button:hover .view-gallery-hint,
.service-button.long-pressing .view-gallery-hint {
    opacity: 1;
    transform: scale(1.1);
}

.service-button.has-image .service-image-preview {
    position: relative;
}
/* Mobile - Even more compact */
@media (max-width: 480px) {
    .service-gallery-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .service-gallery-slider {
        aspect-ratio: 1/1; /* Square on mobile */
    }
    
    .service-gallery-dots {
        padding: 6px 16px;
    }
    
    .service-gallery-info {
        padding: 8px 16px;
    }
    
    .service-gallery-name {
        font-size: 16px;
        margin-bottom: 3px;
    }
    
    .service-gallery-details {
        font-size: 13px;
    }
    
    .service-gallery-select {
        width: calc(100% - 32px);
        margin: 4px 16px 12px;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .service-gallery-nav {
        width: 36px;
        height: 36px;
        opacity: 1;
        visibility: visible;
    }
    
    .service-gallery-nav.prev {
        left: 8px;
    }
    
    .service-gallery-nav.next {
        right: 8px;
    }
    
    .service-gallery-header {
        padding: 12px 16px;
    }
    
    .service-gallery-title {
        font-size: 16px;
    }
}
/* Logo placeholder when no logo is uploaded */
.chat-logo-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5856d6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}