/* =====================================================
   120mAGL REGULATION ASSISTANT WIDGET
   ===================================================== */

/* Floating Action Button */
.reg-assistant-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a4f9c, #1a73e8);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(10, 79, 156, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reg-assistant-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(10, 79, 156, 0.5);
}

.reg-assistant-fab.active {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.reg-assistant-fab.active i::before {
    content: "\f00d"; /* fa-times */
}

/* Chat Panel */
.reg-assistant-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-height: 560px;
    background: var(--bs-body-bg, #fff);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.reg-assistant-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.reg-assistant-header {
    background: linear-gradient(135deg, #0a4f9c, #1a73e8);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.reg-assistant-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.reg-assistant-close:hover {
    opacity: 1;
}

/* Messages */
.reg-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    max-height: 400px;
}

.reg-assistant-welcome {
    text-align: center;
    padding: 16px 0;
}

.reg-assistant-msg {
    max-width: 90%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.reg-assistant-msg-user {
    align-self: flex-end;
    background: #0a4f9c;
    color: white;
    border-bottom-right-radius: 4px;
}

.reg-assistant-msg-assistant {
    align-self: flex-start;
    background: var(--bs-light, #f8f9fa);
    color: var(--bs-body-color, #212529);
    border-bottom-left-radius: 4px;
    max-width: 95%;
}

.reg-assistant-msg-assistant h4,
.reg-assistant-msg-assistant h5,
.reg-assistant-msg-assistant h6 {
    color: #0a4f9c;
    font-size: 0.9rem;
}

.reg-assistant-msg-assistant ul {
    margin-bottom: 0.5rem;
}

.reg-assistant-msg-assistant .form-check {
    padding-left: 1.5rem;
    min-height: auto;
    margin-bottom: 2px;
}

.reg-assistant-tool-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(10, 79, 156, 0.1);
    color: #0a4f9c;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Quick Actions */
.reg-assistant-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.reg-assistant-action-btn {
    background: var(--bs-light, #f0f2f5);
    border: 1px solid rgba(10, 79, 156, 0.15);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #0a4f9c;
    white-space: nowrap;
}

.reg-assistant-action-btn:hover {
    background: rgba(10, 79, 156, 0.1);
    border-color: #0a4f9c;
    transform: translateY(-1px);
}

/* Input Area */
.reg-assistant-input-area {
    padding: 12px;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    flex-shrink: 0;
}

.reg-assistant-input-area .form-control {
    border-radius: 20px;
    font-size: 0.85rem;
    padding-left: 16px;
}

.reg-assistant-input-area .btn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typing indicator */
.reg-assistant-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.reg-assistant-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0a4f9c;
    animation: reg-typing 1.2s infinite;
    opacity: 0.4;
}

.reg-assistant-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.reg-assistant-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes reg-typing {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Dark mode */
[data-theme="dark"] .reg-assistant-panel {
    background: #1a1d21;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .reg-assistant-msg-assistant {
    background: #2d3238;
    color: #e0e0e0;
}

[data-theme="dark"] .reg-assistant-msg-assistant h4,
[data-theme="dark"] .reg-assistant-msg-assistant h5,
[data-theme="dark"] .reg-assistant-msg-assistant h6 {
    color: #6db3f2;
}

[data-theme="dark"] .reg-assistant-action-btn {
    background: #2d3238;
    color: #6db3f2;
    border-color: rgba(109, 179, 242, 0.2);
}

[data-theme="dark"] .reg-assistant-tool-badge {
    background: rgba(109, 179, 242, 0.15);
    color: #6db3f2;
}

[data-theme="dark"] .reg-assistant-input-area {
    border-color: #3d4248;
}

/* Mobile */
@media (max-width: 480px) {
    .reg-assistant-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 80px;
        max-height: 70vh;
        border-radius: 12px;
    }

    .reg-assistant-fab {
        bottom: 16px;
        right: 16px;
    }
}

/* Scrollbar */
.reg-assistant-messages::-webkit-scrollbar {
    width: 4px;
}
.reg-assistant-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
