/**
 * Luxury Concierge Chat Widget Styles
 * WhatsApp Integration for NaijaSuites
 */

/* Floating Concierge Button */
.concierge-button {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(10, 66, 51, 0.9), rgba(26, 107, 79, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(10, 66, 51, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(10, 66, 51, 0.2);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.concierge-button:hover {
    transform: scale(1.08);
    box-shadow: 
        0 12px 40px rgba(10, 66, 51, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        0 0 30px rgba(10, 66, 51, 0.3);
}

.concierge-button:focus-visible {
    outline: 2px solid rgba(10, 66, 51, 0.8);
    outline-offset: 4px;
}

.concierge-button.active {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(26, 107, 79, 0.95), rgba(10, 66, 51, 0.95));
}

.concierge-button-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.concierge-button-inner i {
    font-size: 24px;
    color: white;
}

.whatsapp-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
}

.whatsapp-indicator i {
    font-size: 14px;
    color: white;
}

.concierge-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(10, 66, 51, 0.3);
    animation: conciergePulse 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes conciergePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.3;
    }
}

.concierge-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    animation: badgeBounce 0.5s ease-out;
}

@keyframes badgeBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Chat Panel */
.concierge-panel {
    position: fixed;
    bottom: 112px;
    right: 32px;
    width: 400px;
    max-height: 600px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.concierge-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.concierge-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 600px;
}

/* Chat Header */
.concierge-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(10, 66, 51, 0.05), rgba(26, 107, 79, 0.05));
    border-bottom: 1px solid rgba(10, 66, 51, 0.1);
    gap: 16px;
}

.concierge-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(10, 66, 51, 0.1), rgba(26, 107, 79, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(10, 66, 51, 0.2);
}

.concierge-avatar i {
    font-size: 20px;
    color: rgba(10, 66, 51, 0.8);
}

.concierge-info {
    flex: 1;
}

.concierge-title {
    font-size: 16px;
    font-weight: 600;
    color: #0a4233;
    margin: 0 0 4px 0;
    font-family: 'Cormorant Garamond', serif;
}

.concierge-subtitle {
    font-size: 12px;
    color: rgba(10, 66, 51, 0.7);
    margin: 0 0 6px 0;
    font-family: 'Inter', sans-serif;
}

.concierge-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 11px;
    color: rgba(10, 66, 51, 0.6);
    font-family: 'Inter', sans-serif;
}

.concierge-close {
    width: 32px;
    height: 32px;
    background: rgba(10, 66, 51, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.concierge-close:hover {
    background: rgba(10, 66, 51, 0.1);
    transform: rotate(90deg);
}

.concierge-close:focus-visible {
    outline: 2px solid rgba(10, 66, 51, 0.8);
    outline-offset: 2px;
}

.concierge-close i {
    font-size: 14px;
    color: rgba(10, 66, 51, 0.6);
}

/* Messages Area */
.concierge-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 120px;
}

.concierge-messages::-webkit-scrollbar {
    width: 6px;
}

.concierge-messages::-webkit-scrollbar-track {
    background: rgba(10, 66, 51, 0.05);
    border-radius: 3px;
}

.concierge-messages::-webkit-scrollbar-thumb {
    background: rgba(10, 66, 51, 0.2);
    border-radius: 3px;
}

.concierge-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(10, 66, 51, 0.3);
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(10, 66, 51, 0.05);
    border-radius: 16px;
    width: fit-content;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.typing-indicator.active {
    opacity: 1;
    transform: translateY(0);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(10, 66, 51, 0.4);
    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);
    }
}

.welcome-message {
    padding: 16px;
    background: linear-gradient(135deg, rgba(10, 66, 51, 0.08), rgba(26, 107, 79, 0.08));
    border-radius: 16px;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.welcome-message.hidden {
    display: none;
}

.welcome-message:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.welcome-message p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(10, 66, 51, 0.8);
    margin: 0 0 8px 0;
    font-family: 'Inter', sans-serif;
}

.welcome-message p:last-child {
    margin-bottom: 0;
}

/* Quick Actions */
.concierge-actions {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    border-top: 1px solid rgba(10, 66, 51, 0.1);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(10, 66, 51, 0.03);
    border: 1px solid rgba(10, 66, 51, 0.1);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(10, 66, 51, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.action-btn:hover {
    background: rgba(10, 66, 51, 0.08);
    border-color: rgba(10, 66, 51, 0.2);
    transform: translateY(-2px);
}

.action-btn.active {
    background: linear-gradient(135deg, rgba(10, 66, 51, 0.1), rgba(26, 107, 79, 0.1));
    border-color: rgba(10, 66, 51, 0.3);
    color: #0a4233;
}

.action-btn:focus-visible {
    outline: 2px solid rgba(10, 66, 51, 0.8);
    outline-offset: 2px;
}

.action-btn span {
    font-size: 16px;
}

/* Form Area */
.concierge-form {
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(10, 66, 51, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.concierge-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(10, 66, 51, 0.03);
    border: 1px solid rgba(10, 66, 51, 0.15);
    border-radius: 10px;
    font-size: 13px;
    color: rgba(10, 66, 51, 0.8);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.concierge-input::placeholder {
    color: rgba(10, 66, 51, 0.4);
}

.concierge-input:focus {
    background: rgba(10, 66, 51, 0.05);
    border-color: rgba(10, 66, 51, 0.3);
    box-shadow: 0 0 0 3px rgba(10, 66, 51, 0.1);
}

.concierge-textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(10, 66, 51, 0.03);
    border: 1px solid rgba(10, 66, 51, 0.15);
    border-radius: 10px;
    font-size: 13px;
    color: rgba(10, 66, 51, 0.8);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
    resize: none;
    margin-bottom: 8px;
}

.concierge-textarea::placeholder {
    color: rgba(10, 66, 51, 0.4);
}

.concierge-textarea:focus {
    background: rgba(10, 66, 51, 0.05);
    border-color: rgba(10, 66, 51, 0.3);
    box-shadow: 0 0 0 3px rgba(10, 66, 51, 0.1);
}

.character-counter {
    text-align: right;
    font-size: 11px;
    color: rgba(10, 66, 51, 0.5);
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.concierge-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
    outline: none;
}

.concierge-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.concierge-submit:active:not(:disabled) {
    transform: translateY(0);
}

.concierge-submit:focus-visible {
    outline: 2px solid rgba(37, 211, 102, 0.8);
    outline-offset: 2px;
}

.concierge-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.concierge-submit.loading {
    pointer-events: none;
}

.concierge-submit.loading span {
    opacity: 0.7;
}

.concierge-submit.loading::after {
    content: '';
    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);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .concierge-button {
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
    }

    .concierge-button-inner i {
        font-size: 20px;
    }

    .whatsapp-indicator {
        width: 20px;
        height: 20px;
    }

    .whatsapp-indicator i {
        font-size: 12px;
    }

    .concierge-panel {
        bottom: 96px;
        right: 16px;
        left: 16px;
        width: auto;
        max-height: 70vh;
    }

    .concierge-header {
        padding: 16px;
    }

    .concierge-avatar {
        width: 40px;
        height: 40px;
    }

    .concierge-avatar i {
        font-size: 18px;
    }

    .concierge-title {
        font-size: 14px;
    }

    .concierge-subtitle {
        font-size: 11px;
    }

    .concierge-actions {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px 16px;
    }

    .action-btn {
        font-size: 11px;
        padding: 8px 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .concierge-form {
        padding: 12px 16px 16px;
    }
}

@media (max-width: 480px) {
    .concierge-button {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }

    .concierge-panel {
        bottom: 88px;
        right: 12px;
        left: 12px;
        max-height: 65vh;
    }

    .concierge-actions {
        grid-template-columns: 1fr;
    }
}

/* Safe Area Support for Mobile */
@supports (padding: max(0px)) {
    .concierge-button {
        bottom: max(24px, env(safe-area-inset-bottom));
        right: max(24px, env(safe-area-inset-right));
    }

    .concierge-panel {
        bottom: max(96px, calc(88px + env(safe-area-inset-bottom)));
        right: max(16px, env(safe-area-inset-right));
        left: max(16px, env(safe-area-inset-left));
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .concierge-button {
        background: #0a4233;
        border: 2px solid white;
    }

    .concierge-panel {
        background: white;
        border: 2px solid #0a4233;
    }

    .action-btn {
        border: 2px solid #0a4233;
    }

    .concierge-input,
    .concierge-textarea {
        border: 2px solid #0a4233;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .concierge-button,
    .concierge-panel,
    .concierge-pulse,
    .status-dot,
    .typing-indicator span,
    .welcome-message,
    .action-btn,
    .concierge-input,
    .concierge-textarea,
    .concierge-submit {
        animation: none;
        transition: none;
    }

    .concierge-pulse {
        display: none;
    }
}
