/*
 * Oneway Travels Chat Widget
 * Estilos para el widget flotante
 */

:root {
    --owt-primary: #121f41;
    --owt-secondary: #FF5400;
}

/* Widget container */
#owt-chat-widget {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#owt-chat-widget.owt-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#owt-chat-widget.owt-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Botón flotante */
#owt-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--owt-secondary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

#owt-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#owt-chat-toggle:active {
    transform: scale(0.95);
}

#owt-chat-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* Animación de pulso */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

#owt-chat-toggle.pulse {
    animation: pulse 2s infinite;
}

/* Ventana del chat */
#owt-chat-window {
    position: fixed;
    bottom: 100px;
    width: 400px;
    height: 600px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 140px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    background: white;
    flex-direction: column;
}

#owt-chat-widget.owt-position-bottom-right #owt-chat-window {
    right: 20px;
}

#owt-chat-widget.owt-position-bottom-left #owt-chat-window {
    left: 20px;
}

#owt-chat-window.open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* Header del chat */
.owt-chat-header {
    background: var(--owt-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.owt-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.owt-header-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.owt-chat-header span {
    font-weight: 600;
    font-size: 16px;
}

/* Header actions */
.owt-chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Botón pantalla completa */
#owt-chat-fullscreen {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#owt-chat-fullscreen svg {
    width: 18px;
    height: 18px;
}

#owt-chat-fullscreen:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#owt-chat-fullscreen:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Botón cerrar */
#owt-chat-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    line-height: 1;
}

#owt-chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#owt-chat-close:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* iFrame */
#owt-chat-window iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: #f9fafb;
}

/* Loading state */
#owt-chat-window.loading::after {
    content: "Cargando...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    #owt-chat-toggle {
        width: 56px;
        height: 56px;
    }

    #owt-chat-toggle svg {
        width: 26px;
        height: 26px;
    }

    #owt-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 110px);
        bottom: 80px;
        left: 10px !important;
        right: 10px !important;
        border-radius: 12px;
    }

    #owt-chat-widget.owt-position-bottom-right,
    #owt-chat-widget.owt-position-bottom-left {
        right: 10px;
    }

    .owt-chat-header {
        padding: 14px 16px;
    }

    .owt-chat-header span {
        font-size: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    #owt-chat-toggle,
    #owt-chat-window,
    #owt-chat-close {
        transition: none;
        animation: none;
    }
}

/* Print - ocultar widget al imprimir */
@media print {
    #owt-chat-widget {
        display: none !important;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    #owt-chat-window {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }
}

/* Modo pantalla completa */
#owt-chat-window.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 999999;
}

#owt-chat-window.fullscreen .owt-chat-header {
    border-radius: 0;
}

/* Ocultar botón flotante cuando está en pantalla completa */
#owt-chat-widget.has-fullscreen #owt-chat-toggle {
    display: none;
}

/* Cambiar ícono del botón fullscreen cuando está activo */
#owt-chat-fullscreen.active svg {
    transform: rotate(45deg);
}
