/* Web Chat Widget Styles */

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Noto Sans', sans-serif;
}

/* Chat Button */
.chat-button {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 26, 79, 0.3);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.chat-button:hover {
    background: var(--secondary-blue);
    transform: scale(1.1);
}

.chat-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header .status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    opacity: 0.9;
}

.chat-header .status-dot {
    width: 8px;
    height: 8px;
    background: #4cd964;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-header .close-chat {
    background: none;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.chat-header .close-chat:hover {
    opacity: 1;
}

/* Chat Body */
.chat-body {
    height: calc(100% - 140px);
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message Styles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-self: flex-start;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
}

.message.user {
    align-self: flex-end;
    background: var(--primary-blue);
    color: var(--white);
    border-bottom-right-radius: 5px;
}

.message .time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.quick-reply {
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-reply:hover {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

/* Chat Input */
.chat-input {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.chat-input form {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    border-color: var(--primary-blue);
}

.chat-input button {
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background: var(--secondary-blue);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    width: fit-content;
    margin-top: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--medium-gray);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Chat Options */
.chat-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chat-option {
    padding: 8px 16px;
    background: var(--light-gray);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-option:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* Chat History */
.chat-history {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.chat-history-item {
    padding: 10px 15px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-history-item:hover {
    background: var(--light-gray);
    border-color: var(--primary-blue);
}

.chat-history-item .date {
    font-size: 11px;
    color: var(--medium-gray);
    margin-top: 5px;
}

/* Chat Themes */
.chat-widget.theme-dark .chat-window {
    background: #1a1a1a;
    color: #ffffff;
}

.chat-widget.theme-dark .chat-header {
    background: #2d2d2d;
}

.chat-widget.theme-dark .chat-body {
    background: #1a1a1a;
}

.chat-widget.theme-dark .message.bot {
    background: #2d2d2d;
    border-color: #404040;
}

.chat-widget.theme-dark .chat-input {
    background: #2d2d2d;
    border-color: #404040;
}

.chat-widget.theme-dark .chat-input input {
    background: #1a1a1a;
    border-color: #404040;
    color: #ffffff;
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .chat-window {
        width: calc(100vw - 40px);
        right: -20px;
        height: 70vh;
    }
    
    .chat-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 20px);
        right: -10px;
        height: 80vh;
    }
}

/* Chat Notification */
.chat-notification {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: var(--primary-blue);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 250px;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.chat-notification .close-notification {
    background: none;
    border: none;
    color: var(--white);
    font-size: 14px;
    cursor: pointer;
    opacity: 0.8;
}

.chat-notification .close-notification:hover {
    opacity: 1;
}

/* Chat Welcome Screen */
.chat-welcome {
    text-align: center;
    padding: 30px 20px;
}

.chat-welcome .avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 15px;
}

.chat-welcome h4 {
    margin: 0 0 10px;
    color: var(--primary-blue);
}

.chat-welcome p {
    margin: 0 0 20px;
    color: var(--medium-gray);
    font-size: 14px;
}

/* Chat Rating */
.chat-rating {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.chat-rating p {
    margin: 0 0 15px;
    color: var(--dark-gray);
    font-size: 14px;
}

.chat-rating .stars {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.chat-rating .star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s ease;
}

.chat-rating .star:hover,
.chat-rating .star.active {
    color: #ffc107;
}

.chat-rating .feedback {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    resize: none;
}

.chat-rating button {
    padding: 8px 20px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chat-rating button:hover {
    background: var(--secondary-blue);
}