/**
 * Hotel Booking Engine - Sync Styles
 * 
 * Base synchronization styles for frontend integration
 */

/* Sync status indicator */
.hbe-sync-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    color: #0369a1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.hbe-sync-status.show {
    opacity: 1;
    transform: translateX(0);
}

.hbe-sync-status.active {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.hbe-sync-status.loading {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #d97706;
}

.hbe-sync-status.error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

/* Loading animation for sync operations */
.hbe-sync-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: hbe-spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes hbe-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced form elements for sync */
.hbe-sync-enhanced {
    position: relative;
}

.hbe-sync-enhanced::after {
    content: "⚡";
    position: absolute;
    top: -4px;
    right: -4px;
    background: #10b981;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    z-index: 10;
}

/* Sync update notification */
.hbe-sync-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    z-index: 1001;
}

.hbe-sync-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.hbe-sync-notification.success {
    background: #059669;
}

.hbe-sync-notification.warning {
    background: #d97706;
}

.hbe-sync-notification.error {
    background: #dc2626;
}

/* Debug mode styles */
body.hbe-debug-mode .hbe-sync-status {
    display: block !important;
}

body.hbe-debug-mode .hbe-sync-enhanced::after {
    display: block !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hbe-sync-status {
        top: 10px;
        right: 10px;
        font-size: 11px;
        padding: 6px 12px;
    }

    .hbe-sync-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }
}

/* Hide sync indicators by default unless in debug mode */
.hbe-sync-status,
.hbe-sync-enhanced::after {
    display: none;
}

/* Show only when explicitly enabled or in debug mode */
.hbe-sync-debug .hbe-sync-status,
.hbe-sync-debug .hbe-sync-enhanced::after,
body[data-hbe-debug="true"] .hbe-sync-status,
body[data-hbe-debug="true"] .hbe-sync-enhanced::after {
    display: block;
}

/* Accessibility improvements */
.hbe-sync-status:focus,
.hbe-sync-notification:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hbe-sync-status {
        border-width: 2px;
        font-weight: 600;
    }

    .hbe-sync-notification {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .hbe-sync-status,
    .hbe-sync-notification {
        transition: none;
    }

    .hbe-sync-loading {
        animation: none;
        border-top-color: #6b7280;
    }
}