* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-bottom: 70px;
    overflow-x: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

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

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1em;
    opacity: 0.9;
}

.powered-by {
    position: fixed;
    top: 15px;
    right: 20px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
}

.powered-by a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.powered-by a:hover {
    text-decoration: underline;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(calc(100% - 50px));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.handle-bar {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    transition: background 0.2s;
}

.bottom-sheet-handle:hover .handle-bar {
    background: #bbb;
}

.handle-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #667eea;
}

.bottom-sheet-content {
    padding: 0 25px 25px;
}

.info-desc {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.info-credentials {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9em;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.info-label {
    font-weight: 600;
    color: #555;
    width: 80px;
    flex-shrink: 0;
}

.info-row span:not(.info-label) {
    color: #333;
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #999;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: #e9ecef;
    color: #667eea;
}

.copy-btn.copied {
    color: #28a745;
}

.bottom-sheet a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.bottom-sheet a:hover {
    text-decoration: underline;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.message {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.user-message {
    justify-content: flex-end;
}

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

.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #f1f3f4;
    color: #333;
}

.typing {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
}

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

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.chat-form {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

#user-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

#user-input:focus {
    border-color: #667eea;
}

/* Image upload button */
.image-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e9ecef;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.image-upload-btn:hover {
    background: #dee2e6;
    color: #667eea;
}

/* Image preview container */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.image-preview-container:empty {
    display: none;
}

.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.image-preview .remove-image:hover {
    background: rgba(220, 53, 69, 0.9);
}

#send-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#send-btn:active {
    transform: translateY(0);
}

#send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Message images */
.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.message-images img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-images img:hover {
    transform: scale(1.02);
}

/* Feedback buttons */
.feedback-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
}

.feedback-btn:hover {
    background: #f0f0f0;
}

.feedback-btn.thumbs-up:hover,
.feedback-btn.thumbs-up.selected {
    background: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

.feedback-btn.thumbs-down:hover,
.feedback-btn.thumbs-down.selected {
    background: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

.feedback-btn.selected {
    pointer-events: none;
}

.feedback-btn svg {
    width: 16px;
    height: 16px;
}

.feedback-toast {
    font-size: 0.75em;
    color: #28a745;
    animation: fadeInOut 2s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Feedback comment modal */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.feedback-modal.show {
    opacity: 1;
    visibility: visible;
}

.feedback-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.feedback-modal h3 {
    margin: 0 0 16px;
    color: #333;
}

.feedback-modal textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.feedback-modal textarea:focus {
    outline: none;
    border-color: #667eea;
}

.feedback-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

.feedback-modal-buttons button {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-modal-buttons .cancel-btn {
    background: #f0f0f0;
    border: none;
    color: #666;
}

.feedback-modal-buttons .cancel-btn:hover {
    background: #e0e0e0;
}

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

.feedback-modal-buttons .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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