/* Chatbot specific variables - these match theme.css but are defined here for independence */
:root {
    /* Purple theme variables to match old version */
    --chat-primary: #000000;
    --chat-secondary: #2f3542;
    --chat-bg: #f9fafb;
    --chat-user-bubble: #000000;
    --chat-bot-bubble: #e5e7eb;
    --chat-header-bg: #000000;
    --text-white: #ffffff;
    --text-color: #111827;
    --border-color: #e5e7eb;
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --transition-normal: 0.2s;
  }

  .dark-mode {
    --chat-bg: #1f2937;
    --chat-user-bubble: #6366f1;
    --chat-bot-bubble: #374151;
    --chat-header-bg: #3730a3;
    --text-white: #ffffff;
    --text-color: #f9fafb;
    --border-color: #4b5563;
  }

/* ===== CHATBOT SIDEPANEL STYLING ===== */

/* === Sidepanel Structure === */
.chat-sidepanel {
    width: 400px;
    height: 100vh;
    background-color: var(--chat-bg);
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-sidepanel.left {
    box-shadow: none;
    border: none;
}

/* === Chat Container === */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    border: none;
}

/* === Header === */
.chat-header {
    background-color: var(--chat-header-bg);
    color: var(--text-white);
    padding: 1.25rem;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    border-bottom: none;
}

.chat-position-toggle {
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    font-size: 1rem;
}

/* === Messages Area === */
.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 1.25rem;
    background-color: var(--chat-bg);
}

.message {
    margin-bottom: 1rem;
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.user-message {
    background-color: var(--chat-primary);
    color: var(--text-white);
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.bot-message {
    background-color: var(--chat-bot-bubble);
    color: var(--text-color);
    margin-right: auto;
    border-bottom-left-radius: 0.25rem;
}

/* === Typing Indicator === */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background-color: #e5e7eb;
    border-radius: 1rem;
    width: fit-content;
    margin-bottom: 1rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #6b7280;
    border-radius: 50%;
    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);
    }
}

/* === Input Area === */
.chat-input-container {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    background-color: #f9fafb;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #4f46e5;
}

/* === Input Actions === */
.input-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    background-color: transparent;
    border: none;
}

.action-btn:hover {
    background-color: #e5e7eb;
    color: #4f46e5;
}

.action-btn.active {
    color: #4f46e5;
}

/* Stop button specific styling */
#stop-btn {
    background-color: #ef4444;
    color: white;
    transition: all 0.3s ease;
}

#stop-btn:hover {
    background-color: #dc2626;
    color: white;
    transform: scale(1.05);
}

/* === File Upload === */
.file-drop-area {
    position: relative;
    overflow: visible !important;
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-preview {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.file-preview-item {
    background-color: #e5e7eb;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-preview-item button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.8rem;
}

/* === Chat & Quick Action Buttons === */
.chat-action-btn, .quick-action-btn {
    border-radius: 4px;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    background-color: #dfe4ea !important; /* Light purple */
    color: #57606f; /* Deep navy */
    border: 1px solid rgba(79, 70, 229, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 200ms ease-in-out;
    cursor: pointer;
    outline: none;
}

.chat-action-btn:hover, .quick-action-btn:hover {
    background-color: #57606f !important;
    color: #FFFFFF;
    box-shadow: none !important;
    transform: none !important;
    border-radius: 4px !important;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.chat-action-btn:active, .quick-action-btn:active {
    transform: scale(0.95);
    transition: all 100ms ease-in-out;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.1);
}

.chat-action-btn:focus, .quick-action-btn:focus {
    outline: none;
}

/* === Button Group and History Items === */
.button-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    background-color: rgba(243, 244, 246, 0.7);
    transition: all 0.2s ease;
}

.button-group-header:hover {
    background-color: rgba(243, 244, 246, 0.9);
}

.button-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 4px;
}

.button-group-title i {
    font-size: 0.7rem;
    color: #57606f;
}

.button-group-toggle {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.75rem;
    opacity: 0.75;
    transition: all 0.2s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.button-group-toggle span {
    font-size: 0.7rem;
    font-weight: 500;
}

.button-group-toggle:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: #57606f;
    opacity: 1;
}

.button-group-toggle i {
    transition: transform 0.3s ease;
}

.button-group-toggle.collapsed i {
    transform: rotate(180deg);
}

#chat-action-buttons,
#quick-action-buttons {
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    transform-origin: top;
    overflow: hidden;
}

.buttons-collapsed #chat-action-buttons,
.buttons-collapsed #quick-action-buttons {
    max-height: 0 !important;
    opacity: 0;
    transform: scaleY(0);
    margin: 0;
    padding: 0;
}

/* === History Items === */
.history-item {
    transition: all 0.2s ease;
    position: relative;
}

.history-item.selected {
    background-color: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.history-item.selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #57606f;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.history-item.selected span {
    color: #57606f !important;
    font-weight: 600 !important;
}

/* === Tooltips === */
.chat-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background-color: #57606f;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    margin-bottom: 4px;
    z-index: 9999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-align: center;
    line-height: 1.4;
    min-width: 80px;
    max-width: 240px;
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.group:hover .chat-tooltip,
.group:focus .chat-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Bottom positioned tooltip variant */
.chat-tooltip-down {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 4px;
}

.chat-tooltip-down::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent #1f2937 transparent;
}

/* === Undo Toast === */
.undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.undo-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.undo-toast .undo-btn {
    background-color: #57606f;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.undo-toast .undo-btn:hover {
    background-color: #57606f;
}

/* === Drop Overlay === */
.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(79, 70, 229, 0.2);
    border: 2px dashed #57606f;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #57606f;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.drop-overlay.active {
    opacity: 1;
} 