/* =========================================
   YROS CHAT WIDGET - APP STYLE (Minimalist/Dark)
   ========================================= */

:root {
    --yros-primary: #00f2ff;
    --yros-secondary: #0051ff;
    --yros-dark: #121212;
    --yros-glass-bg: rgba(30, 30, 35, 0.95);
    /* More opaque for app readibility */
    --yros-glass-border: rgba(255, 255, 255, 0.1);
    --yros-msg-user-bg: #404050;
    --yros-msg-bot-bg: rgba(0, 81, 255, 0.15);
    --yros-text-color: #e0e0e0;
    --yros-font-family: 'Inter', sans-serif;
    --yros-glow: 0 0 15px rgba(0, 242, 255, 0.2);
}

/* --- Floating Button (Elegant Glassmorphism) --- */
#yros-floating-btn {
    position: fixed;
    bottom: 125px;
    right: 1rem;
    width: 55px;
    height: 55px;
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 20px rgba(255, 215, 0, 0.15);
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: visible;
}

/* Subtle shimmer on border */
#yros-floating-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.3),
            rgba(255, 215, 0, 0.2),
            rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.6;
    animation: yrosSubtleShimmer 3s ease-in-out infinite;
}

@keyframes yrosSubtleShimmer {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

#yros-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 30px rgba(255, 215, 0, 0.25);
    border-color: rgba(255, 215, 0, 0.3);
}

#yros-floating-btn:hover::before {
    opacity: 1;
}

#yros-floating-btn i,
#yros-floating-btn svg {
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    color: #FFD700 !important;
    background: none !important;
    -webkit-text-fill-color: #FFD700 !important;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.3));
    transition: all 0.3s ease;
}

#yros-floating-btn:active {
    transform: translateY(0);
}

#yros-floating-btn.has-notification::after {
    content: '';
    position: absolute;
    top: 0px;
    right: 0px;
    width: 14px;
    height: 14px;
    background: #ff3b30;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* --- Chat Window --- */
#yros-chat-window {
    position: fixed;
    bottom: 195px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--yros-glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--yros-glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#yros-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* --- Header --- */
.yros-chat-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--yros-glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.yros-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.yros-avatar-small {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--yros-secondary), var(--yros-primary));
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.yros-info h4 {
    margin: 0;
    color: white;
    font-family: var(--yros-font-family);
    font-size: 15px;
    font-weight: 600;
}

.yros-status {
    font-size: 11px;
    color: #4cd964;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.yros-status::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #4cd964;
    border-radius: 50%;
}

.yros-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.yros-close-btn:hover {
    color: white;
}

/* --- Body --- */
.yros-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.yros-chat-body::-webkit-scrollbar {
    width: 5px;
}

.yros-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* --- Messages --- */
.yros-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-family: var(--yros-font-family);
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    animation: messageIn 0.3s ease-out forwards;
    word-wrap: break-word;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-bot {
    align-self: flex-start;
    background: var(--yros-msg-bot-bg);
    color: #edf2f7;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 242, 255, 0.05);
}

.msg-user {
    align-self: flex-end;
    background: var(--yros-msg-user-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --- Footer (Input) --- */
.yros-chat-footer {
    padding: 15px;
    border-top: 1px solid var(--yros-glass-border);
    background: rgba(0, 0, 0, 0.15);
}

.yros-input-group {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.07);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.yros-input-group:focus-within {
    border-color: rgba(0, 242, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

.yros-input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-family: var(--yros-font-family);
    font-size: 14px;
    outline: none;
}

.yros-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.yros-send-btn {
    background: transparent;
    border: none;
    color: var(--yros-primary);
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yros-send-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-indicator span {
    width: 5px;
    height: 5px;
    background: var(--yros-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Welcome Popup (Elegant & Compact) --- */
/* --- Welcome Popup (Elegant & Compact) --- */
#yros-welcome-popup {
    position: fixed;
    bottom: 195px;
    right: 20px;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    padding-right: 32px;
    border-radius: 12px;
    color: white;
    font-family: var(--yros-font-family);
    font-size: 13px;
    max-width: 220px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 20px rgba(255, 215, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

#yros-welcome-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    animation: yrosPopupSlideIn 0.4s ease-out;
}

@keyframes yrosPopupSlideIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#yros-welcome-popup::before {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(20, 20, 25, 0.95);
}

#yros-welcome-popup::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 21px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(255, 255, 255, 0.12);
    z-index: -1;
}

#yros-welcome-popup .popup-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 16px;
    animation: yrosWaveHand 1s ease-in-out 2;
}

@keyframes yrosWaveHand {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(20deg);
    }

    75% {
        transform: rotate(-20deg);
    }
}

#yros-welcome-popup .popup-text {
    display: inline;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#yros-welcome-popup .popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: rgba(255, 215, 0, 0.6);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: all 0.2s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#yros-welcome-popup .popup-close:hover {
    background: rgba(255, 215, 0, 0.1);
    color: rgba(255, 215, 0, 1);
    transform: rotate(90deg);
}

@media (max-width: 480px) {
    #yros-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    #yros-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    #yros-floating-btn i,
    #yros-floating-btn svg {
        font-size: 22px !important;
        width: 22px !important;
        height: 22px !important;
    }

    #yros-welcome-popup {
        bottom: 80px;
        right: 50%;
        left: auto;
        transform: translateX(50%);
        max-width: calc(100vw - 40px);
    }

    #yros-welcome-popup.show {
        transform: translateX(50%) translateY(0) scale(1);
    }

    #yros-welcome-popup::before {
        left: 50%;
        transform: translateX(-50%);
    }

    #yros-welcome-popup::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Hide Yros on Mobile/Tablet */
@media (max-width: 768px) {
    #yros-floating-btn,
    #yros-chat-window,
    #yros-welcome-popup {
        display: none !important;
    }
}