/* ===== TABLE BOOKING POPUP - COMPACT & CLEAN ===== */

/* Base Popup */
.ab-booking-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Simple Backdrop */
.ab-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Compact Panel */
.ab-panel {
    position: relative;
    max-width: 440px;
    margin: 8vh auto 0;
    padding: 0 16px;
    z-index: 100000;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card Content - Compact */
.ab-panel > * {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Close Button - Fix z-index */
.ab-close {
    position: absolute;
    box-shadow: none;
    top: 9px;
    right: 24px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.ab-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.05);
}

.ab-close:active {
    transform: scale(0.95);
}

/* Compact Header */
.ab-header {
    text-align: center;
    margin-bottom: 20px;
}

.ab-title {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.ab-sub {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* Compact Form Layout */
.ab-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.ab-field {
    position: relative;
    flex: 1;
}

.ab-field.full { width: 100%; }

/* Compact Input Styles */
.ab-field input,
.ab-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fafafa;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

/* Datetime field with custom placeholder */
.ab-datetime-wrapper {
    position: relative;
}

.ab-datetime-wrapper input[type="datetime-local"] {
    color: transparent;
}

.ab-datetime-wrapper input[type="datetime-local"]:focus,
.ab-datetime-wrapper input[type="datetime-local"]:valid {
    color: #1e293b;
}

.ab-datetime-placeholder {
    position: absolute;
    left: 9px;
    top: 9px;
    font-weight: 500;
    font-size: 16px;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s ease;
}

.ab-datetime-wrapper input[type="datetime-local"]:focus + .ab-datetime-placeholder,
.ab-datetime-wrapper input[type="datetime-local"]:valid + .ab-datetime-placeholder {
    opacity: 0;
    visibility: hidden;
}

.ab-field textarea {
    min-height: 70px;
    resize: vertical;
}

.ab-field input::placeholder,
.ab-field textarea::placeholder {
    color: #94a3b8;
}

/* Focus States */
.ab-field input:focus,
.ab-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Valid States */
.ab-field input:valid:not(:placeholder-shown) {
    border-color: #10b981;
    background: #f0fdf4;
}

/* Honeypot Hidden */
.ab-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Compact Submit Button */
.ab-submit {
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    background: #3b82f6;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ab-submit:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.ab-submit:active {
    transform: translateY(0);
}

.ab-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Compact Message */
.ab-msg {
    margin-top: 12px;
    padding: 10px 12px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ab-msg:not(:empty) {
    animation: messageSlide 0.2s ease-out;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ab-msg[style*="green"] {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.ab-msg[style*="red"] {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Inline Button */
.ab-inline-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    background: #3b82f6;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ab-inline-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Loading State */
.ab-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive - More Compact */
@media (max-width: 768px) {
    .ab-panel {
        margin: 4vh auto 0;
        padding: 0 12px;
    }
    
    .ab-panel > * {
        padding: 20px;
        border-radius: 14px;
    }
    
    .ab-close {
        border-radius: 50% !important;
        right: 20px;
    }
    
    .ab-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .ab-field.half {
        flex: none;
        width: 100%;
    }
    
    .ab-title { font-size: 20px; }
    .ab-sub { font-size: 13px; }
    
    .ab-field input,
    .ab-field textarea {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .ab-submit {
        padding: 12px 18px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ab-panel {
        margin: 2vh auto 0;
        padding: 0 8px;
    }
    
    .ab-panel > * {
        padding: 16px;
        border-radius: 12px;
    }
    
    .ab-header { margin-bottom: 16px; }
    .ab-title { font-size: 18px; }
}

@media (min-width: 1024px) {
    .ab-datetime-placeholder {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .ab-booking-popup { display: none !important; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}