/* Brinxx Chat - Magic e-Verse Style */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --pink-primary: #e9347d;
    --pink-dark: #c12563;
    --pink-light: #ffb3d9;
    --black: #000;
    --white: #fff;
    --gray-100: #f9fafb;
    --gray-200: #e5e7eb;
    --gray-700: #374151;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--pink-primary) 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-container {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    color: var(--white);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 55px;
    height: 55px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    color: var(--pink-primary);
}

.header-info h1 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.status {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

.back-link {
    margin-left: auto;
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover { opacity: 1; }

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--gray-100);
}

.message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.message.user { flex-direction: row-reverse; }

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--pink-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user .message-avatar { background: #667eea; }

.message-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
}

.message.bot .message-bubble {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 6px;
}

/* Typing indicator */
.typing {
    display: none;
    padding: 10px 20px;
    align-items: center;
    gap: 10px;
}

.typing.show { display: flex; }

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #98a2b3;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Input */
.chat-input {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    background: var(--white);
}

.chat-input input {
    flex: 1;
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 14px 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.chat-input input:focus { border-color: var(--pink-primary); }

.chat-input button {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    border: none;
    color: var(--white);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(233, 52, 125, 0.4);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-input button svg {
    width: 22px;
    height: 22px;
}

/* Footer */
.powered-by {
    text-align: center;
    padding: 10px;
    font-size: 0.75rem;
    color: #9ca3af;
    background: var(--gray-100);
}

.powered-by a {
    color: var(--pink-primary);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 480px) {
    body { padding: 0; }
    .chat-container {
        border-radius: 0;
        height: 100vh;
        max-height: none;
    }
}

/* Action Buttons */
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    border: none;
    color: var(--white);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    font-weight: 500;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 52, 125, 0.4);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-bubble {
    max-width: 90% !important;
}

/* ─── Vorige Offertes Panel ─── */
.prev-quotations-bubble {
    max-width: 95% !important;
    width: 100%;
    padding: 16px !important;
}

.prev-quotations-title {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.prev-quotations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.prev-quotation-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    width: 100%;
}

.prev-quotation-item:hover {
    border-color: var(--pink-primary);
    background: #fdf2f8;
}

.prev-quotation-number {
    font-weight: 700;
    color: var(--pink-primary);
    font-size: 0.9rem;
}

.prev-quotation-label {
    font-size: 0.88rem;
    color: var(--gray-700);
}

.prev-quotation-meta {
    font-size: 0.78rem;
    color: #9ca3af;
}

.prev-quotations-new {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    color: var(--gray-500);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.prev-quotations-new:hover {
    border-color: var(--gray-400);
    color: var(--gray-700);
}

/* Label tussen historische berichten en nieuw gesprek */
.chat-history-label {
    text-align: center;
    font-size: 0.78rem;
    color: #9ca3af;
    padding: 8px 16px;
    margin: 8px 0;
    position: relative;
}

.chat-history-label::before,
.chat-history-label::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--gray-200);
}

.chat-history-label::before { left: 0; }
.chat-history-label::after  { right: 0; }

/* Logo Upload Area */
.upload-bubble {
    max-width: 95% !important;
    width: 100%;
}

.upload-area {
    border: 2px dashed var(--gray-200);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-100);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--pink-primary);
    border-width: 3px;
    background: #fdf2f8;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 14px;
    line-height: 1;
}

.upload-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.upload-formats {
    font-size: 0.82rem;
    color: #9ca3af;
}

/* Progress bar */
.progress-container {
    width: 100%;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 8px;
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
    width: 0%;
    transition: width 0.3s;
}
