/* ==========================================================================
   GenY AI Helpdesk Assistant - iGen43 Corporate Chatbot Styles
   ========================================================================== */

/* --- Floating Widget Launcher --- */
.geny-widget-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.geny-widget-launcher:hover {
    transform: translateY(-4px) scale(1.03);
}

.geny-launcher-badge {
    background: rgba(11, 4, 21, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(165, 110, 240, 0.3);
    padding: 8px 14px;
    border-radius: 20px;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(53, 12, 108, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: genyFloatPulse 3s ease-in-out infinite;
}

.geny-launcher-badge .geny-online-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
}

.geny-launcher-button {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #350C6C 0%, #6419C8 50%, #CAAE22 100%);
    padding: 3px;
    box-shadow: 0 10px 30px rgba(100, 25, 200, 0.4), 0 0 20px rgba(202, 174, 34, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geny-launcher-inner {
    width: 100%;
    height: 100%;
    background: #0B0415;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.geny-launcher-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.geny-widget-launcher:hover .geny-launcher-inner img {
    transform: scale(1.1);
}

.geny-notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #CAAE22;
    color: #0B0415;
    border: 2px solid #0B0415;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Chat Container Window --- */
.geny-chat-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: rgba(15, 8, 30, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(165, 110, 240, 0.25);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(100, 25, 200, 0.2);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

.geny-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* --- Header --- */
.geny-header {
    background: linear-gradient(135deg, rgba(53, 12, 108, 0.9), rgba(100, 25, 200, 0.8));
    padding: 16px 20px;
    border-bottom: 1px solid rgba(165, 110, 240, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.geny-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.geny-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #A56EF0, #CAAE22);
}

.geny-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #0B0415;
}

.geny-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border: 2px solid #350C6C;
    border-radius: 50%;
}

.geny-header-info h4 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.geny-badge-tag {
    background: rgba(202, 174, 34, 0.2);
    border: 1px solid rgba(202, 174, 34, 0.5);
    color: #efb622;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.geny-header-info p {
    margin: 2px 0 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.76rem;
}

.geny-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.geny-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #FFFFFF;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.geny-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.geny-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* --- Scope Protection Banner --- */
.geny-guardrail-banner {
    background: rgba(53, 12, 108, 0.4);
    border-bottom: 1px solid rgba(165, 110, 240, 0.15);
    padding: 8px 16px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
}

.geny-guardrail-banner svg {
    width: 14px;
    height: 14px;
    fill: #CAAE22;
    flex-shrink: 0;
}

/* --- Messages Body --- */
.geny-messages-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.geny-messages-body::-webkit-scrollbar {
    width: 5px;
}

.geny-messages-body::-webkit-scrollbar-thumb {
    background: rgba(165, 110, 240, 0.3);
    border-radius: 10px;
}

/* --- Message Bubbles --- */
.geny-msg-row {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

.geny-msg-row.bot {
    align-self: flex-start;
}

.geny-msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.geny-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(165, 110, 240, 0.4);
}

.geny-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.geny-msg-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.geny-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #F8FAF8;
    word-break: break-word;
}

.geny-msg-row.bot .geny-bubble {
    background: rgba(35, 20, 55, 0.9);
    border: 1px solid rgba(165, 110, 240, 0.2);
    border-top-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.geny-msg-row.user .geny-bubble {
    background: linear-gradient(135deg, #6419C8 0%, #350C6C 100%);
    border: 1px solid rgba(165, 110, 240, 0.3);
    border-top-right-radius: 4px;
    color: #FFFFFF;
}

.geny-msg-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.geny-msg-row.user .geny-msg-time {
    text-align: right;
}

/* --- Formatting inside Bubbles --- */
.geny-bubble p {
    margin: 0 0 8px 0;
}
.geny-bubble p:last-child {
    margin-bottom: 0;
}

.geny-bubble a {
    color: #7eb8c9;
    text-decoration: underline;
    font-weight: 500;
}

.geny-bubble a:hover {
    color: #efb622;
}

.geny-bubble ul, .geny-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.geny-bubble li {
    margin-bottom: 4px;
}

.geny-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.geny-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(100, 25, 200, 0.25);
    border: 1px solid rgba(165, 110, 240, 0.4);
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.geny-cta-btn:hover {
    background: rgba(202, 174, 34, 0.3);
    border-color: #efb622;
    color: #efb622;
    transform: translateY(-1px);
}

/* --- Typing Indicator --- */
.geny-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(35, 20, 55, 0.9);
    border: 1px solid rgba(165, 110, 240, 0.2);
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.geny-typing-dot {
    width: 6px;
    height: 6px;
    background: #A56EF0;
    border-radius: 50%;
    animation: genyBounce 1.4s infinite ease-in-out both;
}

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

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

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

/* --- Suggested Quick Chips --- */
.geny-chips-container {
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(165, 110, 240, 0.15);
    background: rgba(10, 5, 20, 0.85);
    max-height: 140px;
    overflow-y: auto;
}

.geny-chips-container::-webkit-scrollbar {
    width: 4px;
}

.geny-chips-container::-webkit-scrollbar-thumb {
    background: rgba(165, 110, 240, 0.4);
    border-radius: 4px;
}

.geny-chip {
    background: rgba(53, 12, 108, 0.6);
    border: 1px solid rgba(165, 110, 240, 0.35);
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.geny-chip:hover {
    background: rgba(100, 25, 200, 0.65);
    border-color: #A56EF0;
    color: #FFFFFF;
    transform: translateX(2px);
}

/* --- Input Bar --- */
.geny-input-area {
    padding: 12px 16px;
    background: rgba(10, 5, 20, 0.95);
    border-top: 1px solid rgba(165, 110, 240, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.geny-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(165, 110, 240, 0.2);
    border-radius: 12px;
    padding: 10px 14px;
    color: #FFFFFF;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.geny-input-field:focus {
    border-color: #A56EF0;
    background: rgba(255, 255, 255, 0.1);
}

.geny-input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.geny-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6419C8, #350C6C);
    border: 1px solid rgba(165, 110, 240, 0.4);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.geny-send-btn:hover {
    background: linear-gradient(135deg, #7A24ED, #4A1094);
    transform: scale(1.05);
}

.geny-send-btn svg {
    width: 18px;
    height: 18px;
    fill: #FFFFFF;
}

/* --- Settings Modal --- */
.geny-settings-modal {
    position: absolute;
    inset: 0;
    background: rgba(10, 5, 20, 0.96);
    backdrop-filter: blur(20px);
    z-index: 10;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.geny-settings-modal.active {
    opacity: 1;
    pointer-events: all;
}

.geny-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(165, 110, 240, 0.2);
    padding-bottom: 12px;
}

.geny-settings-header h4 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
}

.geny-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.geny-form-group label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.geny-form-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(165, 110, 240, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    color: #FFFFFF;
    font-size: 0.82rem;
    outline: none;
}

.geny-form-input:focus {
    border-color: #A56EF0;
}

.geny-save-settings-btn {
    background: linear-gradient(135deg, #6419C8, #CAAE22);
    border: none;
    color: #0B0415;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .geny-widget-launcher {
        bottom: 16px;
        right: 16px;
    }
    .geny-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}
