* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    min-height: 90vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo i {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.message.user .message-content {
    flex-direction: row-reverse;
}

.message-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    text-align: center;
}

.message.assistant .message-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message.user .message-icon {
    background: #28a745;
    color: white;
}

.message-text {
    background: white;
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.message.user .message-text {
    background: #007bff;
    color: white;
}

.message-text p {
    margin-bottom: 10px;
}

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

.message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 5px;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    align-self: flex-end;
}

.message.user .message-time {
    align-self: flex-start;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

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

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    border-color: #667eea;
}

.send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.send-button:hover {
    transform: scale(1.1);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: #6c757d;
    font-size: 0.9rem;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.quick-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    overflow-x: auto;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    white-space: nowrap;
    text-align: center;
}

.quick-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.quick-action-btn i {
    font-size: 1.2rem;
    display: block;
    margin: 0 auto;
}

.quick-action-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar */
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        min-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    body {
        padding: 0;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-messages {
        max-height: 50vh;
    }
    
    .quick-actions {
        padding: 15px;
        justify-content: center;
    }
    
    .quick-action-btn {
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 25px;
    text-align: center;
}

.modal-header i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    opacity: 0.9;
}

.modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.modal-body {
    padding: 30px 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group label i {
    color: #667eea;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid {
    border-color: #dc3545;
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
}

.modal-footer {
    padding: 25px;
    background: #f8f9fa;
    text-align: center;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 150px;
    justify-content: center;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Session Status Indicator */
.session-info {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.session-info.show {
    opacity: 1;
}

.session-info.connected {
    background: rgba(40, 167, 69, 0.9);
}

.session-info.new {
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
}

@media (max-width: 480px) {
    .header {
        padding: 15px;
        position: relative;
    }
    
    .chat-messages {
        padding: 15px;
        max-height: 45vh;
    }
    
    .chat-input-container {
        padding: 15px;
    }
    
    .quick-actions {
        gap: 8px;
        justify-content: center;
    }
    
    .quick-action-btn {
        min-width: 70px;
        padding: 10px 12px;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 25px 20px;
    }
    
    .modal-body {
        padding: 25px 20px;
    }
    
    .modal-footer {
        padding: 20px;
    }
    
    .session-info {
        top: 10px;
        right: 10px;
        font-size: 0.6rem;
        padding: 4px 8px;
    }
}

/* Support Message Styles */
.message.support {
    align-self: flex-start;
}

.message.support .message-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.message.support .message-text {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
    border: 2px solid #28a745;
    position: relative;
}

.support-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.support-badge i {
    font-size: 0.6rem;
}

/* New Message Animation */
.message.new-message {
    animation: newMessagePulse 2s ease-in-out;
}

@keyframes newMessagePulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.02); box-shadow: 0 0 20px rgba(40, 167, 69, 0.3); }
    75% { transform: scale(1.01); box-shadow: 0 0 10px rgba(40, 167, 69, 0.2); }
}

/* Update Notification */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    z-index: 1001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.update-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.update-notification i {
    font-size: 1.2rem;
    animation: bell 1s ease-in-out infinite;
}

@keyframes bell {
    0%, 50%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* Update Button Special Style */
.quick-action-btn.update-btn {
    border-color: #28a745;
    color: #28a745;
}

.quick-action-btn.update-btn:hover {
    border-color: #28a745;
    color: white;
    background: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.quick-action-btn.update-btn i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile styles for new elements */
@media (max-width: 480px) {
    .update-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        border-radius: 10px;
        padding: 10px 15px;
    }
    
    .update-notification.show {
        transform: translateY(0);
    }
    
    .support-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
}
