/* Chat and Feedback Button */
.chat-feedback-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #012e6e 0%, #1a4a8f 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(1, 46, 110, 0.3);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid white;
}

.chat-feedback-button:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #e6c257 100%);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.chat-feedback-button i {
    color: white;
    font-size: 28px;
    transition: transform 0.3s ease;
}

.chat-feedback-button:hover i {
    transform: scale(1.1);
}


/* Rating Form Styles */
.rating-form {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
}

.rating-header h6 {
    color: #012e6e;
    margin-bottom: 5px;
    font-weight: 600;
}

.rating-header p {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 15px;
}

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

.rating-stars input {
    display: none;
}

.star-label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.star-label:hover,
.star-label.active {
    color: #ffc107;
    transform: scale(1.1);
}

.rating-feedback {
    margin-bottom: 15px;
}

.rating-feedback textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.875rem;
    resize: vertical;
}

.rating-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rating-actions .btn {
    min-width: 12px;
}

/* Status Indicators */
.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

.online-indicator.waiting {
    background-color: #ff9800;
}

.offline-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #6c757d;
    border-radius: 50%;
    margin-right: 6px;
}

/* System Messages */
.message-system {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.system-message {
    background: #e3f2fd;
    color: #1565c0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    max-width: 80%;
}

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


/* Chat Widget (Dropdown Style) */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #eaeaea;
}

.chat-widget.show {
    display: flex;
}

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

/* Chat Widget Header */
.chat-widget-header {
    background: linear-gradient(135deg, #012e6e 0%, #1a4a8f 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-logo {
    width: 36px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-widget-header h5 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    flex-grow: 1;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Widget Body */
.chat-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Tabs */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.chat-tab-btn {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.chat-tab-btn.active {
    color: #012e6e;
    border-bottom-color: #012e6e;
    background: white;
}

.chat-tab-btn:hover:not(.active) {
    background-color: #f3f3f4;
    color: #444;
}

/* Tab Content */
.chat-tab-content {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.tab-pane {
    display: none;
    padding: 20px;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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

/* Chat Form */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.form-group {
    margin: 0;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #012e6e;
    box-shadow: 0 0 0 3px rgba(1, 46, 110, 0.1);
    background: white;
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #012e6e 0%, #1a4a8f 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(1, 46, 110, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #e6c257 100%);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Message Status */
.message-status {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.message-status.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    display: block;
}

.message-status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    display: block;
}

.message-status.info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
    display: block;
}

/* Live Chat Window */
.live-chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    max-width: 85%;
    animation: messageAppear 0.3s ease;
}

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

.chat-message.client {
    align-self: flex-end;
}

.chat-message.admin {
    align-self: flex-start;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-message.client .message-bubble {
    background: linear-gradient(135deg, #012e6e 0%, #1a4a8f 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-message.admin .message-bubble {
    background: #f3f3f4;
    color: #333;
    border-bottom-left-radius: 6px;
    border: 1px solid #eaeaea;
}

.timestamp {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 6px;
}

/* Chat Input Area */
.chat-input-area {
    padding: 18px;
    border-top: 1px solid #eee;
    background: white;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group .form-control {
    flex: 1;
    margin: 0;
    padding: 14px;
    border-radius: 25px;
}

.input-group .btn {
    padding: 14px;
    min-width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-status {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Online Status Indicator */
.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

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

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f3f3f4;
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.typing-dots {
    display: flex;
    margin-left: 8px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #999;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Responsive Design */
@media (max-width: 480px) {
    .chat-widget {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        height: 70vh;
        bottom: 90px;
    }
    
    .chat-feedback-button {
        width: 60px;
        height: 60px;
        bottom: 15px;
        right: 15px;
    }
    
    .chat-widget-header {
        padding: 15px;
    }
    
    .chat-tab-btn {
        padding: 12px;
    }
    
    .tab-pane {
        padding: 15px;
    }
}

/* Admin Side Chat Notification */
.chat-notification-icon {
    position: relative;
    margin-right: 15px;
}

.chat-notification-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    padding: 4px 7px;
    border-radius: 50%;
    background-color: #dc3545;
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}