/* Premium Live Support Widget CSS */
.chat-widget-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2147483647;
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* Tooltip Cloud */
.chat-label-cloud {
    position: absolute;
    bottom: 85px;
    right: 0;
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.3);
    animation: chatCloudFloat 3s ease-in-out infinite;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-origin: bottom right;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-label-cloud::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
}

.chat-label-cloud::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 25px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
}

@keyframes chatCloudFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

/* Floating Trigger Button */
.chat-trigger {
    width: 68px;
    height: 68px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.chat-trigger::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.chat-trigger:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

.chat-trigger:hover::before {
    transform: translateX(100%);
}

.chat-trigger i {
    transition: transform 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.chat-trigger.active i {
    transform: rotate(90deg) scale(0.8);
}

/* Chat Window Container */
.chat-window {
    position: absolute;
    bottom: 95px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header Area */
.chat-header {
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 28px 32px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.chat-header::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

#closeChatBtn {
    position: relative;
    z-index: 5;
    transition: all 0.3s ease;
}

#closeChatBtn:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.chat-header-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-header-text h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff !important;
}

.chat-header-text span {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-text span::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

/* Body Area */
.chat-body {
    flex: 1;
    overflow-y: auto;
    background: #fdfdfe;
    display: flex;
    flex-direction: column;
}

/* Forms & Inputs */
.chat-form-view {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-form-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 4px;
}

.chat-input-field {
    width: 100%;
    padding: 14px 20px;
    background: #fff;
    border: 1.5px solid var(--border-light);
    border-radius: 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.chat-input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
    outline: none;
}

/* Messages View */
#chatMessagesView {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    animation: msgIn 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2);
}

.message.admin {
    align-self: flex-start;
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 20px 20px 20px 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 6px;
    display: block;
}

.message.user .message-time { text-align: right; }

/* Input Footer */
.chat-input-row {
    padding: 24px;
    background: #fff;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-bottom-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    padding: 10px 0;
    background: transparent;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.chat-send-btn:hover {
    transform: scale(1.05) rotate(5deg);
    background: var(--primary-dark);
}

/* Waiting View */
.chat-waiting-view {
    padding: 60px 32px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 25px;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

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

.chat-loading-pulse {
    width: 90px;
    height: 90px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 36px;
    position: relative;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.chat-waiting-view h5 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.chat-waiting-view p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 240px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .chat-widget-wrapper {
        bottom: 20px;
        right: 20px;
    }
    
    .chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        z-index: 2147483647;
    }
    
    .chat-trigger {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }
}
