/* Crownate AI Nexus - Chatbot Styles v4.0 */
:root {
    --nexus-navy: #030712;
    --nexus-gold: #ffd700;
    --nexus-accent: #0d6efd;
    --nexus-glass: rgba(255, 255, 255, 0.9);
    --nexus-border: rgba(255, 255, 255, 0.3);
}

#nexus-chatbot-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: var(--nexus-navy);
    border: 2px solid var(--nexus-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexus-gold);
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: nexusPulse 2s infinite;
}

@keyframes nexusPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.trigger-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

#nexus-chatbot-trigger i {
    font-size: 32px;
}

#nexus-chatbot-trigger:hover {
    transform: scale(1.1) rotate(5deg);
}

#nexus-chat-window {
    position: fixed;
    bottom: 115px;
    right: 30px;
    width: 440px;
    max-width: 90vw;
    height: 680px;
    max-height: 80vh;
    background: var(--nexus-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    border: 1px solid var(--nexus-border);
}

#nexus-chat-window.active {
    display: flex;
    animation: nexusFadeUp 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes nexusFadeUp {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nexus-chat-header {
    background: var(--nexus-navy);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.title-group h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.title-group p {
    margin: 0;
    font-size: 11px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nexus-status {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 15px #10b981;
}

.nexus-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(248, 250, 252, 0.5);
}

.nexus-message {
    max-width: 85%;
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
    animation: nexusMsgIn 0.4s ease-out;
}

@keyframes nexusMsgIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.nexus-message.ai {
    background: #ffffff;
    color: #000000;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    font-weight: 500;
}

.nexus-message.user {
    background: #030712;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-weight: 500;
}

.nexus-message.structured {
    max-width: 95%;
    background: #ffffff;
    border: 2px solid #030712;
    color: #000000;
}

.nexus-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    animation: nexusMsgIn 0.5s ease-out;
}

.qa-btn {
    background: white;
    border: 1px solid var(--nexus-navy);
    color: var(--nexus-navy);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qa-btn:hover {
    background: var(--nexus-navy);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.structured-response strong {
    color: var(--nexus-navy);
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.structured-response ul {
    margin: 10px 0;
    padding-left: 20px;
}

.structured-response li {
    margin-bottom: 5px;
    color: #475569;
}

.wisdom-badge {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.wisdom-badge i {
    color: var(--nexus-gold);
    font-size: 18px;
    margin-top: -2px;
}

.nexus-chat-input {
    padding: 24px;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 15px;
}

.nexus-chat-input input {
    flex: 1;
    border: 2px solid #030712;
    padding: 14px 20px;
    border-radius: 16px;
    outline: none;
    font-size: 14px;
    background: #ffffff;
    color: #000000;
    font-weight: 600;
    transition: all 0.3s;
}

.nexus-chat-input input:focus {
    border-color: var(--nexus-accent);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.nexus-chat-input button {
    background: var(--nexus-navy);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.nexus-chat-input button:hover {
    background: #111827;
    transform: translateY(-2px);
}

.typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    margin-right: 5px;
    animation: nexusTyping 1.4s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes nexusTyping {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 1; }
}

/* Verification Form Styles */
.verification-form-container {
    padding: 10px 5px;
}

#nexus-verification-form .form-control {
    border-radius: 12px;
    padding: 12px 15px;
    border: 2px solid #030712;
    font-size: 14px;
    width: 100%;
    margin-bottom: 15px;
    background: #ffffff;
    color: #000000;
    font-weight: 600;
}

#nexus-verification-form .form-control:focus {
    border-color: var(--nexus-accent);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.live-agent-options {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px;
    border-radius: 16px;
}

.wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: white;
    padding: 10px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.wa-btn:hover {
    color: white;
    transform: translateY(-2px);
    background: #128c7e;
}

.wa-btn i {
    font-size: 18px;
}

.reset-btn,
.live-agent-header-btn {
    cursor: pointer;
    font-size: 1.2rem;
}

.nexus-message.structured {
    max-width: 95%;
    background: #ffffff;
    border: 2px solid #030712;
    color: #000000;
}

.nexus-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    animation: nexusMsgIn 0.5s ease-out;
}

.qa-btn {
    background: white;
    border: 1px solid var(--nexus-navy);
    color: var(--nexus-navy);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.qa-btn:hover {
    background: var(--nexus-navy);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.structured-response strong {
    color: var(--nexus-navy);
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.structured-response ul {
    margin: 10px 0;
    padding-left: 20px;
}

.structured-response li {
    margin-bottom: 5px;
    color: #475569;
}

.wisdom-badge {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.wisdom-badge i {
    color: var(--nexus-gold);
    font-size: 18px;
    margin-top: -2px;
}

.nexus-chat-input {
    padding: 24px;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 15px;
}

.nexus-chat-input input {
    flex: 1;
    border: 2px solid #030712;
    padding: 14px 20px;
    border-radius: 16px;
    outline: none;
    font-size: 14px;
    background: #ffffff;
    color: #000000;
    font-weight: 600;
    transition: all 0.3s;
}

.nexus-chat-input input:focus {
    border-color: var(--nexus-accent);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.nexus-chat-input button {
    background: var(--nexus-navy);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.nexus-chat-input button:hover {
    background: #111827;
    transform: translateY(-2px);
}

.typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    margin-right: 5px;
    animation: nexusTyping 1.4s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes nexusTyping {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 1; }
}

/* Verification Form Styles */
.verification-form-container {
    padding: 10px 5px;
}

#nexus-verification-form .form-control {
    border-radius: 12px;
    padding: 12px 15px;
    border: 2px solid #030712;
    font-size: 14px;
    width: 100%;
    margin-bottom: 15px;
    background: #ffffff;
    color: #000000;
    font-weight: 600;
}

#nexus-verification-form .form-control:focus {
    border-color: var(--nexus-accent);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.live-agent-options {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px;
    border-radius: 16px;
}

.wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: white;
    padding: 10px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.wa-btn:hover {
    color: white;
    transform: translateY(-2px);
    background: #128c7e;
}

.wa-btn i {
    font-size: 18px;
}

.reset-btn,
.live-agent-header-btn {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--nexus-gold);
    margin-right: 15px;
    transition: transform 0.3s ease;
}

.reset-btn:hover,
.live-agent-header-btn:hover {
    transform: scale(1.1) rotate(15deg);
}

/* --- Action Cards & Data Grids --- */
.nexus-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-top: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: nexusMsgIn 0.5s ease-out;
}

.nexus-card-header {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.nexus-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.data-item {
    display: flex;
    flex-direction: column;
}

.data-label {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

.data-value {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

.nexus-action-btn {
    width: 100%;
    background: #030712;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nexus-action-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.nexus-status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 900;
}

.status-verified { background: #dcfce7; color: #166534; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-flagged { background: #fee2e2; color: #991b1b; }

/* --- Multi-Modal & Upload Enhancements --- */
.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 16px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: #e2e8f0;
    color: var(--nexus-navy);
}

#nexus-upload-preview {
    background: white;
    padding: 10px 24px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 10px;
}

#nexus-upload-preview.hidden {
    display: none;
}

.preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--nexus-navy);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-file {
    position: absolute;
    top: -2px;
    right: -2px;
    background: white;
    color: #ef4444;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
}

.message-image {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.nexus-message.user .message-image {
    border-color: rgba(255,255,255,0.2);
}

.file-name {
    display: none; /* Just show the image */
}

/* --- Thinking Process --- */
.nexus-thinking-process {
    align-self: flex-start;
    background: rgba(3, 7, 18, 0.05);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    border: 1px dashed #cbd5e1;
    animation: nexusFadeIn 0.3s ease;
}

@keyframes nexusFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nexus-thinking-process i.spin {
    animation: nexusSpin 2s linear infinite;
    color: var(--nexus-gold);
}

@keyframes nexusSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Humanized AI Enhancements */
#nexus-mood-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    margin-right: 15px;
}

#nexus-mood-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    transition: all 0.5s ease;
}

.nexus-message.ai.typing-mode::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 14px;
    background: var(--nexus-gold);
    margin-left: 4px;
    vertical-align: middle;
    animation: nexusCursorBlink 0.8s infinite;
}

@keyframes nexusCursorBlink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}
