/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Import Binance Font - IBM Plex Sans */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* Desktop Background */
body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0b0e11;
    background-image:
        radial-gradient(ellipse at 20% 80%, rgba(43, 49, 57, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(43, 49, 57, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(24, 26, 32, 0.8) 0%, transparent 70%);
    color: #eaecef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0;
    margin: 0;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 680px;
    height: 100vh;
    max-height: 100vh;
    background-color: #1e2329;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

/* Header - Lighter background */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    background-color: #202630;
}

.chat-header.hidden {
    display: none;
}

.header-title {
    font-size: 16px;
    font-weight: 500;
    color: #eaecef;
    letter-spacing: 0;
    flex: 1;
}

/* Chat Header Alt (for chat view) */
.chat-header-alt {
    padding: 16px 24px;
    background-color: #1e2329;
    border-bottom: 1px solid #2b3139;
}

.back-btn {
    background: none;
    border: none;
    color: #eaecef;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.header-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-avatar svg {
    width: 100%;
    height: 100%;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-title-chat {
    font-size: 14px;
    font-weight: 600;
    color: #eaecef;
}

.header-case-id {
    font-size: 12px;
    font-weight: 400;
    color: #848e9c;
}

.close-btn {
    background: none;
    border: none;
    color: #848e9c;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.close-btn:hover {
    color: #eaecef;
}

.globe-btn {
    background: none;
    border: none;
    color: #eaecef;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.globe-btn svg {
    width: 20px;
    height: 20px;
}

/* Views */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background-color: #181a20;
}

.view.active {
    display: flex;
}

/* Search Box */
.search-container {
    padding: 0 24px 20px;
    background-color: #1e2329;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #2b3139;
    border-radius: 8px;
    padding: 0 16px;
    height: 48px;
}

.search-icon {
    color: #5e6673;
    margin-right: 12px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: #eaecef;
    font-size: 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    outline: none;
}

.search-input::placeholder {
    color: #5e6673;
}

/* Home Content - Darker background */
.home-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    background-color: #181a20;
}

/* Custom Scrollbar */
.home-content::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.home-content::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: #181a20;
}

.home-content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #2b3139;
    border-radius: 2px;
}

/* Welcome Message */
.welcome-message {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 16px;
    font-size: 14px;
    font-weight: 400;
    color: #eaecef;
}

.wave-emoji {
    font-size: 16px;
    line-height: 1;
}

/* Feature Card */
.feature-card {
    background-color: #2b3139;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.feature-card:hover {
    background-color: #323840;
}

.feature-content {
    max-width: 70%;
}

.feature-title {
    font-size: 14px;
    font-weight: 600;
    color: #eaecef;
    margin-bottom: 6px;
    line-height: 1.4;
}

.feature-description {
    font-size: 12px;
    font-weight: 400;
    color: #848e9c;
    line-height: 1.5;
    margin-bottom: 14px;
}

.learn-more-btn {
    background-color: #fcd535;
    color: #181a20;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'IBM Plex Sans', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.learn-more-btn:hover {
    background-color: #e5c232;
}

.feature-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-70%);
}

.feature-icon svg {
    width: 40px;
    height: 40px;
}

.view-all-link {
    position: absolute;
    right: 16px;
    bottom: 16px;
    color: #fcd535;
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Suggestions Section */
.suggestions-section {
    margin-top: 4px;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.suggestions-title {
    font-size: 14px;
    font-weight: 600;
    color: #eaecef;
}

.refresh-btn {
    background: none;
    border: none;
    color: #5e6673;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

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

.refresh-btn:hover {
    color: #848e9c;
}

.refresh-btn.spinning {
    transform: rotate(360deg);
}

/* Suggestions List */
.suggestions-list {
    list-style: none;
}

.suggestion-item {
    padding: 12px 0;
}

.suggestion-item a {
    color: #eaecef;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    display: block;
    line-height: 1.4;
    cursor: pointer;
}

.suggestion-item a:hover {
    color: #fcd535;
}

/* Chat View */
#chat-view {
    height: 100%;
    position: relative;
    background-color: #181a20;
}

/* Agent Info - inside chat messages, scrolls with content */
.agent-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 16px;
    background-color: transparent;
}

.agent-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.agent-avatar svg {
    width: 100%;
    height: 100%;
}

.agent-name {
    font-size: 14px;
    font-weight: 600;
    color: #eaecef;
    margin-bottom: 4px;
}

.agent-title {
    font-size: 12px;
    font-weight: 400;
    color: #848e9c;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #181a20;
}

/* Message Bubbles */
.message {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message.user {
    background-color: #fcd535;
    color: #181a20;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background-color: #2b3139;
    color: #eaecef;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Message Time - inline after text */
.message-time {
    font-size: 11px;
    color: #848e9c;
    margin-left: 8px;
    white-space: nowrap;
}

.message.user .message-time {
    color: rgba(24, 26, 32, 0.5);
}

/* System Message */
.message.system {
    background-color: #2b3139;
    color: #848e9c;
    align-self: center;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: center;
    max-width: 90%;
}

.message.system .system-message-content {
    line-height: 1.6;
}

/* Notification Popup Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.notification-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.notification-popup {
    background-color: #1e2329;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.notification-overlay.show .notification-popup {
    transform: scale(1);
}

.popup-dismiss {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #848e9c;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.popup-dismiss:hover {
    background-color: #2b3139;
    color: #eaecef;
}

.popup-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(252, 213, 53, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fcd535;
    margin: 0 auto 20px;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    color: #eaecef;
    margin-bottom: 8px;
}

.popup-text {
    font-size: 14px;
    color: #848e9c;
    line-height: 1.5;
    margin-bottom: 24px;
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'IBM Plex Sans', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}

.popup-btn-yes {
    background-color: #fcd535;
    color: #181a20;
}

.popup-btn-yes:hover {
    background-color: #e5c232;
}

.popup-btn-no {
    background-color: transparent;
    color: #848e9c;
}

.popup-btn-no:hover {
    color: #eaecef;
}

/* Scroll Down Button */
.scroll-down-btn {
    position: absolute;
    right: 24px;
    bottom: 90px;
    width: 40px;
    height: 40px;
    background-color: #2b3139;
    border: none;
    border-radius: 50%;
    color: #eaecef;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
    z-index: 10;
}

.scroll-down-btn:hover {
    background-color: #3c4043;
}

.scroll-down-btn svg {
    width: 20px;
    height: 20px;
}

.scroll-down-btn.hidden {
    display: none;
}

/* Message Input - Same background as header */
.message-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background-color: #202630;
    border-top: 1px solid #2b3139;
}

.attach-btn {
    background: none;
    border: none;
    color: #848e9c;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attach-btn svg {
    width: 24px;
    height: 24px;
}

.attach-btn:hover {
    color: #eaecef;
}

.message-input-box {
    display: flex;
    align-items: center;
    background-color: #2b3139;
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: #eaecef;
    font-size: 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    padding: 6px 8px;
    outline: none;
    resize: none;
    min-height: 22px;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4;
}

.message-input::placeholder {
    color: #5e6673;
}

.send-btn {
    background: none;
    border: none;
    color: #848e9c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

.send-btn:hover {
    color: #eaecef;
}

.add-btn {
    background: none;
    border: none;
    color: #fcd535;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-btn svg {
    width: 24px;
    height: 24px;
}

.add-btn:hover {
    opacity: 0.8;
}

/* Attachment Preview */
.attachment-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background-color: #1e2329;
    border-top: 1px solid #2b3139;
}

.attachment-preview.hidden {
    display: none;
}

.preview-content {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #2b3139;
    flex-shrink: 0;
}

.preview-content img,
.preview-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.preview-content img.show,
.preview-content video.show {
    display: block;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#preview-name {
    font-size: 14px;
    color: #eaecef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#preview-size {
    font-size: 12px;
    color: #848e9c;
}

.preview-remove {
    background: none;
    border: none;
    color: #848e9c;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.preview-remove:hover {
    background-color: #2b3139;
    color: #f6465d;
}

.preview-remove svg {
    width: 20px;
    height: 20px;
}

/* Message with attachment */
.message.user.has-attachment {
    padding: 0;
    background-color: transparent;
    overflow: visible;
}

.message.has-attachment .message-attachment .message-time {
    position: absolute;
    bottom: 8px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message.has-attachment .message-attachment .message-time::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.message-attachment {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    max-width: 250px;
}

.message-attachment img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

.message-attachment video {
    display: block;
    width: 100%;
    max-height: 300px;
    border-radius: 12px;
}

/* Message with text + attachment */
.message.user.has-attachment.has-text {
    padding: 0;
    background-color: transparent;
}

.message.user.has-attachment.has-text .message-text {
    background-color: #fcd535;
    color: #181a20;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-right-radius: 4px;
    margin-bottom: 8px;
}

.message.assistant.has-attachment {
    padding: 0;
    background-color: transparent;
}

.message.assistant.has-attachment .message-text {
    background-color: #2b3139;
    color: #eaecef;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    margin-bottom: 8px;
}

/* Upload progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.upload-progress-bar {
    flex: 1;
    height: 4px;
    background-color: #2b3139;
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background-color: #fcd535;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 12px;
    color: #848e9c;
    min-width: 40px;
    text-align: right;
}

/* Responsive - Mobile fills screen */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .chat-container {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chat-header,
    .search-container,
    .home-content,
    .chat-messages,
    .message-input-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .scroll-down-btn {
        right: 16px;
    }
}

/* Image Modal / Lightbox */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-modal.show {
    display: flex;
    opacity: 1;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.image-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.image-modal-close svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* Clickable images in chat */
.clickable-image {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clickable-image:hover {
    opacity: 0.9;
}

/* Close Chat Confirmation Modal */
.close-chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.close-chat-modal.show {
    display: flex;
    opacity: 1;
}

.close-chat-modal-content {
    background-color: #1e2329;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.close-chat-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.close-chat-avatar svg {
    width: 100%;
    height: 100%;
}

.close-chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #eaecef;
    margin-bottom: 12px;
}

.close-chat-message {
    font-size: 14px;
    color: #848e9c;
    line-height: 1.5;
    margin-bottom: 24px;
}

.close-chat-confirm-btn {
    width: 100%;
    padding: 14px 20px;
    background-color: #fcd535;
    border: none;
    border-radius: 8px;
    color: #181a20;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background-color 0.2s ease;
}

.close-chat-confirm-btn:hover {
    background-color: #e5c232;
}

.close-chat-cancel-btn {
    width: 100%;
    padding: 14px 20px;
    background-color: transparent;
    border: none;
    color: #fcd535;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-chat-cancel-btn:hover {
    color: #e5c232;
}

/* Chat Feedback Section (after chat is closed) */
.chat-feedback {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-card {
    background-color: #2b3139;
    border-radius: 12px;
    padding: 16px 20px;
    border: none;
}

.feedback-question {
    font-size: 14px;
    font-weight: 400;
    color: #eaecef;
    text-align: center;
    margin-bottom: 12px;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
}

.feedback-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.feedback-no {
    background-color: #3b4149;
    border: none;
    color: #eaecef;
}

.feedback-no:hover {
    background-color: #4a5058;
}

.feedback-no.selected {
    background-color: #f6465d;
    color: #fff;
}

.feedback-yes {
    background-color: #3b4149;
    border: none;
    color: #eaecef;
}

.feedback-yes:hover {
    background-color: #4a5058;
}

.feedback-yes.selected {
    background-color: #0ecb81;
    color: #fff;
}

.rating-card.hidden {
    display: none;
}

.rating-options {
    display: flex;
    justify-content: space-around;
    gap: 4px;
}

.rating-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rating-option:hover {
    transform: scale(1.1);
}

.rating-option svg {
    width: 32px;
    height: 32px;
}

.rating-option span {
    font-size: 10px;
    color: #848e9c;
}

.rating-option.selected svg circle:first-child {
    fill: #fcd535;
}

.rating-option.selected span {
    color: #fcd535;
}
