/* ==========================================================================
   NOOR AI AGENT STYLESHEET (Executive Banking Advisory Interface)
   ========================================================================== */

/* Launcher Button (AgencyOS High-Impact Animated Launcher) */
.noor-launcher {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 99;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 8px 8px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #4bbfa0;
    border-radius: 999px;
    box-shadow: 0 0 0 1px #4bbfa0, 0 0 18px rgba(75, 191, 160, 0.35), 0 8px 28px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    color: var(--ink);
    animation: noorLauncherFloat 4s ease-in-out infinite, noorLauncherGlow 3s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.noor-launcher::after {
    content: "";
    position: absolute;
    inset: -3px;
    border: 2px solid transparent;
    border-top-color: #d4a017;
    border-bottom-color: #4bbfa0;
    border-radius: 999px;
    pointer-events: none;
    animation: noorBorderTrace 3.5s linear infinite;
}

.noor-launcher:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 0 0 2px #d4a017, 0 0 26px rgba(212, 160, 23, 0.45), 0 16px 40px rgba(0, 0, 0, 0.25);
    border-color: #d4a017;
}

.noor-launcher-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: visible;
    flex-shrink: 0;
}

.noor-launcher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    box-shadow: 0 0 0 2px var(--surface);
}

.noor-launcher-avatar::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: noorAvatarPulse 2.4s ease-out infinite;
    pointer-events: none;
}

.noor-pulse-indicator {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 11px;
    height: 11px;
    background: #10b981;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
    animation: noorLiveDotPulse 1.8s ease-in-out infinite;
    z-index: 2;
}

@keyframes noorLauncherFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes noorLauncherGlow {
    0%, 100% {
        box-shadow: 0 0 0 1px #4bbfa0, 0 0 16px rgba(75, 191, 160, 0.3), 0 8px 26px rgba(0, 0, 0, 0.16);
    }
    50% {
        box-shadow: 0 0 0 2px #d4a017, 0 0 24px rgba(212, 160, 23, 0.4), 0 14px 34px rgba(0, 0, 0, 0.22);
    }
}

@keyframes noorBorderTrace {
    0% { border-top-color: #d4a017; border-bottom-color: #4bbfa0; }
    50% { border-top-color: #4bbfa0; border-bottom-color: #d4a017; }
    100% { border-top-color: #d4a017; border-bottom-color: #4bbfa0; }
}

@keyframes noorAvatarPulse {
    0% { transform: scale(0.9); opacity: 0.85; }
    70% { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

@keyframes noorLiveDotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); box-shadow: 0 0 12px rgba(16, 185, 129, 1); }
}

.noor-launcher-meta {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.noor-launcher-meta strong {
    font-size: 13.5px;
    color: var(--ink);
    line-height: 1.2;
}

.noor-launcher-meta small {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--gold);
}

/* Noor Dialog Container */
.noor-dialog {
    position: fixed;
    right: 28px;
    bottom: 96px;
    width: min(440px, calc(100vw - 32px));
    height: min(600px, calc(100vh - 120px));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Allows circular avatar to protrude out of the box */
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.noor-dialog.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dialog Header */
.noor-dialog-head {
    padding: 16px 20px 14px 18px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 64px;
}

.noor-advisor-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.noor-avatar-pop-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    margin-top: -42px; /* Protrudes top half outside the box, lower half inside header */
    margin-bottom: -6px;
    flex-shrink: 0;
    z-index: 10;
}

.noor-headshot {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 3px solid var(--gold);
    box-shadow: 
        0 0 0 3px var(--surface),
        0 10px 26px rgba(0, 0, 0, 0.4),
        0 0 16px rgba(212, 175, 55, 0.35);
    background: var(--surface);
    display: block;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.noor-avatar-pop-wrap:hover .noor-headshot {
    transform: scale(1.05);
    box-shadow: 
        0 0 0 3px var(--surface),
        0 14px 32px rgba(0, 0, 0, 0.48),
        0 0 22px rgba(212, 175, 55, 0.5);
}

.noor-pop-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2.5px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
    z-index: 2;
    animation: noorLiveDotPulse 1.8s ease-in-out infinite;
}

.noor-advisor-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.noor-advisor-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.25;
}

.noor-advisor-title span {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--gold);
    display: block;
    margin-top: 3px;
    letter-spacing: 0.03em;
}

.noor-close-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.noor-close-btn:hover {
    background: var(--surface);
    color: var(--ink);
}

/* Tabs: Chat vs Voice */
.noor-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.noor-tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.noor-tab-btn.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--surface);
}

/* Body / Chat Area */
.noor-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Quick Action Prompt Chips */
.noor-prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.noor-chip {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.15s ease;
}

.noor-chip:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* Messages */
.noor-msg {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.noor-msg.assistant {
    align-self: flex-start;
    background: var(--surface-soft);
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 2px;
}

.noor-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

/* Voice Panel */
.noor-voice-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    flex: 1;
}

.noor-voice-panel.is-active {
    display: flex;
}

.noor-voice-avatar-ring {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid var(--gold);
    overflow: hidden;
}

.noor-voice-avatar-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.noor-equalizer-bars {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    margin-bottom: 18px;
}

.noor-equalizer-bars span {
    width: 3px;
    height: 6px;
    background: var(--gold);
    border-radius: 99px;
    transition: height 0.15s ease;
}

.noor-equalizer-bars.is-active span {
    animation: noor-eq 0.9s ease-in-out infinite alternate;
}

.noor-equalizer-bars span:nth-child(1) { animation-delay: 0.1s; }
.noor-equalizer-bars span:nth-child(2) { animation-delay: 0.25s; }
.noor-equalizer-bars span:nth-child(3) { animation-delay: 0.4s; }
.noor-equalizer-bars span:nth-child(4) { animation-delay: 0.15s; }
.noor-equalizer-bars span:nth-child(5) { animation-delay: 0.3s; }
.noor-equalizer-bars span:nth-child(6) { animation-delay: 0.5s; }
.noor-equalizer-bars span:nth-child(7) { animation-delay: 0.2s; }
.noor-equalizer-bars span:nth-child(8) { animation-delay: 0.35s; }

@keyframes noor-eq {
    0% { height: 4px; }
    100% { height: 26px; }
}

.noor-voice-status {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 16px;
}

/* Input Form */
.noor-input-form {
    padding: 12px 16px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
}

.noor-input-form input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--ink);
    outline: none;
}

.noor-send-btn {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.noor-send-btn:hover {
    background: #0d5ad1;
    transform: scale(1.05);
}

.noor-foot-legal {
    padding: 8px 16px;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .noor-launcher {
        display: none !important; /* Managed via .bottom-nav Noor button on mobile */
    }

    .noor-dialog {
        right: 10px;
        left: 10px;
        bottom: 74px;
        width: auto;
        height: calc(100vh - 90px);
        max-height: 580px;
        border-radius: 14px;
    }
}
