/* Dexter AI Chat v1.2.0 Frontend Styles */
#dac-widget-root.dac-widget-root {
    position: fixed !important;
    right: 22px !important;
    bottom: 22px !important;
    z-index: 2147483000 !important;
    pointer-events: auto !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.45;
    color: #1c2838;
}

#dac-widget-root * {
    box-sizing: border-box;
}

.dac-hidden {
    display: none !important;
}

.dac-launcher-btn {
    display: flex !important;
    align-items: center;
    gap: 12px;
    background: #0f294a !important;
    color: #ffffff !important;
    border: 2px solid #c5a059 !important;
    border-radius: 999px !important;
    padding: 8px 18px 8px 8px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 10px 28px rgba(15, 41, 74, 0.35) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dac-launcher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 41, 74, 0.45) !important;
}

.dac-launcher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dac-launcher-avatar svg {
    width: 48px;
    height: 48px;
    display: block;
}

.dac-launcher-label {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.dac-launcher-label strong {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.dac-launcher-label small {
    font-size: 12px;
    color: #e6d3ab;
}

.dac-chat-panel {
    position: fixed;
    right: 22px;
    bottom: 92px;
    width: 390px;
    max-width: calc(100vw - 28px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(15, 41, 74, 0.16);
    box-shadow: 0 18px 48px rgba(15, 41, 74, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483000 !important;
    pointer-events: auto !important;
}

.dac-panel-header {
    background: #0f294a;
    color: #ffffff;
    padding: 14px 16px;
    border-bottom: 3px solid #c5a059;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dac-header-profile {
    display: flex;
    align-items: center;
    gap: 11px;
}

.dac-header-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.dac-header-avatar svg {
    width: 44px;
    height: 44px;
    display: block;
}

.dac-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.dac-header-badge {
    font-size: 11.5px;
    color: #e9d7b0;
    margin-top: 2px;
}

.dac-close-btn {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 26px !important;
    line-height: 1 !important;
    padding: 2px 6px !important;
    cursor: pointer !important;
    opacity: 0.85;
}

.dac-close-btn:hover {
    opacity: 1;
}

.dac-gate-view {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
}

.dac-gate-intro {
    font-size: 15px;
    color: #243447;
    margin: 0 0 14px 0;
}

.dac-hp-wrap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.dac-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0f294a;
    margin: 10px 0 5px;
}

.dac-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f294a;
    background: #f8fafc;
}

.dac-input:focus,
.dac-textarea:focus {
    outline: none;
    border-color: #0f294a;
    background: #ffffff;
}

.dac-error-box {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 13px;
}

.dac-primary-btn {
    width: 100%;
    margin-top: 14px;
    padding: 11px 16px !important;
    background: #0f294a !important;
    color: #ffffff !important;
    border: 1px solid #c5a059 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.dac-primary-btn:hover {
    background: #163a66 !important;
}

.dac-secondary-btn {
    width: 100%;
    padding: 9px 12px !important;
    background: #fdfaf3 !important;
    color: #0f294a !important;
    border: 1px solid #c5a059 !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.dac-secondary-btn:hover {
    background: #f6ecd6 !important;
}

.dac-eu-notice {
    margin-top: 14px;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
}

.dac-chat-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.dac-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dac-msg {
    max-width: 86%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.dac-msg-assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 3px;
}

.dac-msg-user {
    align-self: flex-end;
    background: #0f294a;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.dac-typing-box {
    padding: 8px 14px;
    background: #fdfaf3;
    border-top: 1px solid #ece3ce;
    font-size: 12.5px;
    color: #0f294a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dac-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #c5a059;
    border-top-color: #0f294a;
    border-radius: 50%;
    display: inline-block;
    animation: dacSpin 0.8s linear infinite;
}

@keyframes dacSpin {
    to { transform: rotate(360deg); }
}

.dac-handoff-box,
.dac-post-handoff-actions {
    padding: 8px 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dac-post-handoff-actions .dac-primary-btn {
    margin-top: 0;
}

.dac-message-form {
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.dac-textarea {
    flex: 1;
    resize: none;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    max-height: 95px;
}

.dac-send-btn {
    padding: 10px 15px !important;
    background: #0f294a !important;
    color: #ffffff !important;
    border: 1px solid #c5a059 !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

@media (max-width: 480px) {
    #dac-widget-root.dac-widget-root {
        right: 12px !important;
        bottom: 12px !important;
    }
    .dac-chat-panel {
        right: 10px;
        bottom: 78px;
        width: calc(100vw - 20px);
        height: calc(100vh - 96px);
    }
    .dac-launcher-label small {
        display: none;
    }
}

.dac-msg-links {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.dac-course-cta-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px !important;
    background: #0f294a !important;
    color: #ffffff !important;
    border: 1.5px solid #c5a059 !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    transition: background 0.16s ease, transform 0.16s ease;
    box-shadow: 0 3px 10px rgba(15, 41, 74, 0.16);
}

.dac-course-cta-btn:hover,
.dac-course-cta-btn:focus {
    background: #163a66 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.dac-course-cta-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #c5a059;
    color: #0f294a;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.dac-inline-link {
    color: #0f294a !important;
    font-weight: 600;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.dac-inline-link:hover {
    color: #8c6b28 !important;
}

@media (max-width: 600px) {
    #dac-widget-root.dac-widget-root {
        right: 14px !important;
        bottom: 16px !important;
        max-width: calc(100vw - 28px) !important;
    }
    .dac-launcher-btn {
        padding: 6px 14px 6px 6px !important;
        gap: 9px !important;
    }
    .dac-launcher-avatar, .dac-launcher-avatar svg {
        width: 40px !important;
        height: 40px !important;
    }
    .dac-launcher-label strong {
        font-size: 13.5px !important;
    }
}
