/* ═══════════════════════════════════════════════
   URBANGPT CHATBOT - Visual Design v2
   Aligned with landing page premium design
   ═══════════════════════════════════════════════ */

/* Reset */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff !important;
    color: #111827 !important;
    overflow: hidden;
}

/* Chat Wrapper */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(var(--vh, 1vh) * 100);
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    position: relative;
    z-index: 1;
}

/* Header */
.chat-header {
    background-color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
    z-index: 10;
}

.chat-header .icon-left {
    cursor: pointer;
    margin-right: 10px;
    display: flex;
    align-items: center;
    font-size: 20px;
    color: #6b7280;
    transition: color 0.2s;
}

.chat-header .icon-left:hover {
    color: #00297a;
}

.chat-header .logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.chat-header .logo-link img {
    max-width: 100%;
    height: auto;
    max-height: 44px;
    cursor: pointer;
}

.chat-header .join-link {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background-color: #0D47A1;
    cursor: pointer;
    text-decoration: none;
    padding: 8px 22px;
    border-radius: 50px;
    display: inline-block;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

.chat-header .join-link:hover {
    background-color: #1565C0;
    transform: translateY(-1px);
}

/* User greeting */
.user-greeting {
    position: relative;
    display: inline-block;
    cursor: pointer;
    color: #111827;
    font-weight: 600;
}

.user-greeting i {
    margin-left: 5px;
    font-size: 14px;
}

.user-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 160px;
}

.user-menu.show {
    display: block;
}

.menu-item {
    background-color: #fff;
    color: #374151;
    border: none;
    padding: 10px 12px;
    margin: 2px 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px;
}

.menu-item:hover {
    background-color: #eef3ff;
    color: #00297a;
}

.menu-item i {
    margin-right: 8px;
    color: #6b7280;
}

/* Chat Content */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    overflow: hidden;
}

.usage-info {
    padding: 10px 16px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scroll-behavior: auto;
    will-change: scroll-position;
    touch-action: pan-y;
    background-color: #fff;
}

/* Messages */
.message {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
    width: 100%;
}

.message-content {
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.55;
    position: relative;
    background-color: #f7f9fc;
    color: #374151;
    word-wrap: break-word;
    margin-bottom: 4px;
}

.bot-message .message-content {
    background-color: #f0f4ff !important;
    border: 1px solid #e5e7eb;
    text-align: left;
    color: #374151;
    border-bottom-left-radius: 4px;
}

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

.user-message .message-content {
    background-color: #00297a;
    color: #fff;
    align-self: flex-end;
    border: none;
    border-bottom-right-radius: 4px;
}

/* Action Buttons */
.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    gap: 4px;
}

.action-button {
    background-color: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    margin-left: 0;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-button:hover {
    background-color: #eef3ff;
    border-color: #00297a;
    color: #00297a;
}

/* Input Container */
.input-container {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: none;
    position: relative;
    z-index: 10;
    gap: 8px;
}

#user-input {
    flex-grow: 1;
    padding: 10px 18px;
    background-color: #fff;
    border: 1px solid #d0d0d2;
    border-radius: 50px;
    font-size: 15px;
    outline: none;
    box-shadow: none;
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
    resize: none;
    transition: border-color 0.2s;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-appearance: none;
}

#user-input:focus {
    border-color: #0D47A1;
    box-shadow: none;
}

#user-input::placeholder {
    color: #9ca3af;
}

#send-button {
    padding: 10px 24px;
    background-color: #0D47A1;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
    font-family: 'Inter', -apple-system, sans-serif;
    white-space: nowrap;
    margin-top: 0;
}

#send-button:hover {
    background-color: #1565C0;
    transform: translateY(-1px);
}

/* Thinking Indicator */
.thinking-indicator {
    display: none;
    text-align: center;
    margin-bottom: 14px;
    font-size: 14px;
    color: #6b7280;
    padding: 10px;
}

/* Suggested Questions */
.suggested-questions {
    display: none;
}

.question-button {
    padding: 8px 14px;
    background-color: #f7f9fc;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 14px;
    color: #374151;
}

.question-button:hover, .question-button:focus {
    background-color: #eef3ff;
    border-color: #00297a;
    color: #00297a;
}

.question-button strong {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 14px;
}

/* Footer */
.footer-text {
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #9ca3af;
    text-align: center;
    margin: 0;
    padding: 8px 16px;
    background-color: #fff;
    border-top: none;
    position: relative;
}

/* Feedback */
.feedback-link {
    color: #00297a;
    text-decoration: underline;
}

.feedback-link:hover {
    color: #0D47A1;
}

.send-feedback, .skip-feedback {
    background-color: #0D47A1;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, sans-serif;
}

.send-feedback:hover, .skip-feedback:hover {
    background-color: #1565C0;
}

.feedback-input textarea {
    border-radius: 12px;
    border: 1px solid #d0d0d2;
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
    outline: none;
}

.feedback-input textarea:focus {
    border-color: #0D47A1;
}

/* Limit Reached */
.limit-reached-message {
    background-color: #eef3ff;
    color: #00297a;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 10px 30px rgba(0,41,122,0.08);
    margin: 20px 0;
    border: 1px solid #e5e7eb;
}

.limit-reached-message h2 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 800;
    color: #111827;
}

.limit-reached-message p {
    font-size: 15px;
    margin-bottom: 16px;
    color: #374151;
}

.limit-reached-message .join-button {
    background-color: #0D47A1;
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: all 0.25s ease;
    font-size: 14px;
}

.limit-reached-message .join-button:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
}

/* ═══ RESPONSIVE MOBILE ═══ */
@media (max-width: 767px) {
    .chat-wrapper {
        height: 100vh;
        max-width: 100%;
        margin: 0;
        height: calc(var(--vh, 1vh) * 100);
        border-radius: 0;
        box-shadow: none;
    }

    .chat-header {
        padding: 10px 14px;
    }

    .chat-header .logo-link img {
        max-height: 36px;
    }

    .chat-messages {
        padding: 12px;
    }

    .message-content, #user-input, #send-button {
        font-size: 14px;
    }

    .bot-message .message-content {
        padding: 10px 14px;
    }

    .input-container {
        padding: 10px 12px;
        gap: 6px;
    }

    #user-input {
        padding: 9px 16px;
    }

    #send-button {
        padding: 9px 18px;
        font-size: 13px;
    }

    .footer-text {
        padding: 6px 12px;
        font-size: 11px;
    }

    .suggested-questions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 10px 12px 5px;
    }

    .question-button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ═══ RESPONSIVE DESKTOP ═══ */
@media (min-width: 768px) {
    .chat-wrapper {
        max-width: calc(100% - 40px);
        width: 1100px;
        margin: 20px auto;
        height: calc(100vh - 40px);
        box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 10px 40px rgba(0,41,122,0.08);
        border-radius: 16px;
        border: 1px solid #e5e7eb;
        overflow: hidden;
    }

    .chat-header {
        border-bottom: 1px solid #e5e7eb;
        padding: 12px 20px;
    }

    .chat-header .logo-link img {
        max-height: 36px;
    }

    .input-container {
        padding: 12px 20px;
        background-color: #f8fafc;
        border-top: 1px solid #e5e7eb;
    }

    .chat-messages {
        padding: 16px 20px;
    }

    .chat-messages::-webkit-scrollbar {
        width: 4px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

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

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

    .message-content {
        max-width: 75%;
        font-size: 15px;
    }

    .suggested-questions {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin: 10px 0;
        width: 100%;
        padding: 0 20px;
    }

    .question-button {
        width: 100%;
    }

    .footer-text {
        padding: 8px 20px;
        font-size: 11px;
    }
}
