/* Chat Widget Styles */
:root {
    --primary-color: #0066cc;
    --primary-light: #3385d6;
    --accent-color: #ff6b35;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --text-lighter: #999999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chat-widget * {
    box-sizing: border-box;
}

.chat-widget .chat-button {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    border: none !important;
    color: white !important;
    font-size: 24px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.4) !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-decoration: none !important;
    font-weight: normal !important;
    line-height: 1 !important;
}

.chat-widget .chat-button span:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.5);
}

.chat-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.chat-button.has-notification .notification-badge {
    display: flex;
}

.chat-widget .chat-container {
    position: absolute !important;
    bottom: 80px !important;
    right: 0 !important;
    width: 380px !important;
    height: 600px !important;
    max-height: 600px !important;
    background: white !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 10000 !important;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    visibility: hidden;
}

.chat-widget .chat-container.active {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.chat-header .chat-status {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-close,
.chat-new-conversation {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.chat-close {
    font-size: 1.5rem;
}

.chat-new-conversation {
    font-size: 1.25rem;
}

.chat-new-conversation svg {
    width: 18px;
    height: 18px;
}

.chat-close:hover,
.chat-new-conversation:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.chat-message.bot .chat-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.chat-message.user .chat-avatar {
    background: linear-gradient(135deg, var(--secondary-color), #00c77a);
    color: white;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-bubble strong {
    font-weight: 600;
}

.chat-bubble a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
}

.chat-bubble a:hover {
    opacity: 1;
}

.chat-bubble ul,
.chat-bubble ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-bubble li {
    margin: 0.25rem 0;
}

.chat-message.bot .chat-bubble {
    background: white;
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-lighter);
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

.chat-message.user .chat-time {
    text-align: right;
}

.chat-typing {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    align-items: center;
    justify-content: flex-start;
    margin-top: 0.5rem;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-lighter);
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.9375rem;
    resize: none;
    max-height: 100px;
    transition: var(--transition);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-send:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send svg {
    width: 20px;
    height: 20px;
}

.chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chat-quick-button {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
}

.chat-quick-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chat-schedule-form {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.chat-schedule-form.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

.chat-schedule-form h4 {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
    font-size: 1.125rem;
}

.chat-schedule-form .form-group {
    margin-bottom: 1rem;
}

.chat-schedule-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.chat-schedule-form input,
.chat-schedule-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

.chat-schedule-form input:focus,
.chat-schedule-form select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-schedule-form .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chat-schedule-form button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chat-schedule-form .btn-submit {
    background: var(--primary-color);
    color: white;
}

.chat-schedule-form .btn-submit:hover {
    background: var(--primary-dark);
}

.chat-schedule-form .btn-cancel {
    background: var(--bg-light);
    color: var(--text-dark);
}

.chat-schedule-form .btn-cancel:hover {
    background: var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100vw - 32px);
        max-width: 380px;
        height: calc(100vh - 120px);
        max-height: 600px;
        bottom: 90px;
        right: 16px;
        left: auto;
    }

    .chat-button {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
        font-size: 22px;
    }

    .chat-header {
        padding: 1rem;
    }

    .chat-header h3 {
        font-size: 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-area {
        padding: 1rem;
    }

    .chat-input {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
    }

    .chat-send {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .quick-actions {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .quick-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
        max-height: 500px;
        bottom: 80px;
        right: 12px;
        border-radius: 16px;
    }

    .chat-button {
        width: 50px;
        height: 50px;
        bottom: 12px;
        right: 12px;
        font-size: 20px;
    }

    .chat-header {
        padding: 0.875rem;
    }

    .chat-header h3 {
        font-size: 0.95rem;
    }

    .chat-header-actions {
        gap: 0.375rem;
    }

    .chat-close,
    .chat-new-conversation {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }

    .chat-messages {
        padding: 0.875rem;
    }

    .message {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        max-width: 85%;
    }

    .message-time {
        font-size: 0.7rem;
    }

    .chat-input-area {
        padding: 0.875rem;
    }

    .chat-input {
        font-size: 0.9rem;
        padding: 0.625rem 0.875rem;
    }

    .chat-send {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .quick-actions {
        padding: 0.625rem;
        gap: 0.375rem;
        flex-wrap: wrap;
    }

    .quick-action-btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
        flex: 1 1 auto;
        min-width: calc(50% - 0.1875rem);
    }

    .typing-indicator {
        padding: 0.75rem 1rem;
    }

    .typing-dot {
        width: 6px;
        height: 6px;
    }
}
    .chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-widget {
        bottom: 15px;
        right: 15px;
    }

    .chat-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }


