/*
 * OpenFrio — Assistant CSS
 * Estilos específicos do Assistente Virtual
 */

.assistant-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.assistant-overlay.active {
    opacity: 1;
    visibility: visible;
}

.assistant-container {
    background-color: #f8fafc;
    width: 100%;
    max-width: 500px;
    height: 90vh;
    max-height: 800px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.assistant-overlay.active .assistant-container {
    transform: translateY(0);
}

/* Header */
.assistant-header {
    background-color: #0d4a8a; /* Azul OpenFrio */
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.assistant-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.assistant-avatar {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.assistant-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.assistant-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.assistant-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.assistant-close:hover {
    opacity: 1;
}

/* Progress */
.assistant-progress {
    background-color: white;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
}

.progress-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #2196f3;
    transition: width 0.4s ease;
}

/* Body / Chat Area */
.assistant-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #f8fafc;
}

/* Scrollbar styling */
.assistant-body::-webkit-scrollbar {
    width: 6px;
}
.assistant-body::-webkit-scrollbar-track {
    background: transparent;
}
.assistant-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Messages */
.msg-row {
    display: flex;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

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

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

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

.msg-bubble {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.msg-bot .msg-bubble {
    background-color: white;
    color: #334155;
    border-bottom-left-radius: 2px;
    border: 1px solid #e2e8f0;
}

.msg-user .msg-bubble {
    background-color: #2196f3;
    color: white;
    border-bottom-right-radius: 2px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    border: 1px solid #e2e8f0;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

/* Footer / Input Area */
.assistant-footer {
    background-color: white;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.input-area::-webkit-scrollbar {
    width: 6px;
}
.input-area::-webkit-scrollbar-track {
    background: transparent;
}
.input-area::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 45vh;
    overflow-y: auto;
}

/* Inputs and Buttons */
.ast-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    background-color: #f8fafc;
}

.ast-input:focus {
    border-color: #2196f3;
    background-color: white;
}

.ast-btn {
    width: 100%;
    padding: 1rem;
    background-color: #f57c00; /* Laranja accent */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ast-btn:hover {
    background-color: #e65100;
}

.ast-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.ast-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ast-btn-outline {
    background-color: white;
    color: #0d4a8a;
    border: 2px solid #0d4a8a;
}

.ast-btn-outline:hover {
    background-color: #f0f7ff;
}

/* Two fields row */
.ast-two-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Options Grid (Tipo de Câmara) */
.ast-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.ast-option-btn {
    padding: 0.75rem 1rem;
    background-color: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.ast-option-btn:hover {
    border-color: #2196f3;
    background-color: #f0f7ff;
}

/* Helper text */
.ast-helper {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Error message */
.ast-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

/* Checkbox (LGPD) */
.ast-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ast-checkbox-wrapper input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.ast-checkbox-wrapper label {
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    line-height: 1.4;
}

.ast-checkbox-wrapper a {
    color: #2196f3;
    text-decoration: underline;
}

/* Review Table */
.ast-review-box {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.ast-review-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.ast-review-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ast-review-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

.ast-review-value {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 500;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .assistant-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .assistant-header {
        border-radius: 0;
    }
}
