/* Rose Chat Interface Styles */
/* Color scheme: Blue (#5B9BD5) + Baby Pink (#FFB5C5) */

/* --- Chat Container --- */
.rose-chat-container {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 400px; height: 520px;
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.92), rgba(20, 30, 50, 0.92));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(91, 155, 213, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.rose-chat-container.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* --- Chat Header --- */
.rose-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a1a2e, #162040);
    border-bottom: 1px solid rgba(91, 155, 213, 0.15);
    flex-shrink: 0;
}

.rose-chat-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5B9BD5, #FFB5C5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.rose-chat-info {
    flex: 1;
}

.rose-chat-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.rose-chat-status {
    font-size: 11px;
    color: #5B9BD5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rose-chat-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #5B9BD5;
    animation: status-pulse 2s ease infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.rose-header-actions {
    display: flex;
    gap: 8px;
}

.rose-header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #aaa;
    width: 30px; height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rose-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* --- Messages --- */
.rose-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(10, 10, 20, 0.3);
}

.rose-messages::-webkit-scrollbar {
    width: 4px;
}

.rose-messages::-webkit-scrollbar-thumb {
    background: rgba(91, 155, 213, 0.3);
    border-radius: 4px;
}

.rose-message {
    display: flex;
    gap: 10px;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rose-message.user {
    flex-direction: row-reverse;
}

.rose-msg-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.rose-message.assistant .rose-msg-avatar {
    background: linear-gradient(135deg, #5B9BD5, #FFB5C5);
}

.rose-message.user .rose-msg-avatar {
    background: linear-gradient(135deg, #4ECDC4, #44a08d);
}

.rose-msg-content {
    max-width: 75%;
}

.rose-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.rose-message.assistant .rose-msg-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: #e8e8e8;
    border-bottom-left-radius: 4px;
}

.rose-message.user .rose-msg-bubble {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.25), rgba(68, 160, 141, 0.25));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.rose-msg-time {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    padding: 0 4px;
}

.rose-message.user .rose-msg-time {
    text-align: right;
}

/* --- Welcome message --- */
.rose-welcome {
    text-align: center;
    padding: 20px;
}

.rose-welcome-text {
    background: linear-gradient(135deg, #5B9BD5, #FFB5C5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
}

/* --- Typing Indicator --- */
.rose-typing {
    display: flex;
    gap: 10px;
    padding: 0 16px 8px;
}

.rose-typing-dots {
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.rose-typing-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #5B9BD5;
    animation: typingBounce 1.4s ease infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Input Area --- */
.rose-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(91, 155, 213, 0.1);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: rgba(10, 10, 25, 0.5);
}

.rose-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.rose-input::placeholder {
    color: #666;
}

.rose-input:focus {
    border-color: rgba(91, 155, 213, 0.4);
}

.rose-send-btn {
    width: 40px; height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #5B9BD5, #FFB5C5);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.rose-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(91, 155, 213, 0.4);
}

.rose-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* --- Counter Bar --- */
.rose-counter-bar {
    padding: 0 16px;
    height: 0;
    overflow: hidden;
    font-size: 11px;
    color: #888;
    text-align: center;
    transition: height 0.2s, color 0.2s;
    background: rgba(10, 10, 25, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rose-counter-bar.visible {
    height: 28px;
    border-top: 1px solid rgba(91, 155, 213, 0.08);
}

.rose-counter-bar.low {
    color: #ff6b6b;
}

/* --- Modal Overlay --- */
.rose-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.rose-modal-card {
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.98), rgba(20, 30, 50, 0.98));
    border: 1px solid rgba(91, 155, 213, 0.25);
    border-radius: 24px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(91, 155, 213, 0.08);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.rose-modal-emoji {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.rose-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
}

.rose-modal-subtitle {
    font-size: 14px;
    color: #aaa;
    line-height: 1.6;
    margin: 0 0 24px;
}

.rose-modal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.rose-modal-input:focus {
    border-color: rgba(91, 155, 213, 0.5);
}

.rose-modal-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #5B9BD5, #FFB5C5);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.rose-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(91, 155, 213, 0.4);
}

.rose-modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.rose-modal-btn.upgrade {
    background: linear-gradient(135deg, #5B9BD5, #4A8BC2);
    margin-bottom: 20px;
}

.rose-modal-btn.upgrade:hover {
    box-shadow: 0 6px 20px rgba(91, 155, 213, 0.45);
}

.rose-modal-error {
    font-size: 13px;
    color: #ff6b6b;
    margin-top: 10px;
    min-height: 18px;
}

.rose-modal-perks {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rose-modal-perks li {
    font-size: 14px;
    color: #ccc;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rose-modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    transition: color 0.2s;
}

.rose-modal-close:hover {
    color: #999;
}

/* =====================================================================
   MOBILE STYLES
   ===================================================================== */
@media (max-width: 768px) {
    .rose-chat-container {
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        height: 55vh;
        max-height: 55vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border: none;
        border-top: 1px solid rgba(91, 155, 213, 0.2);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        opacity: 1;
    }

    .rose-chat-container.visible {
        transform: translateY(0);
        opacity: 1;
    }

    .rose-chat-header {
        background: rgba(0, 0, 0, 0.5);
        padding: 12px 14px;
        position: relative;
    }

    .rose-chat-header::before {
        content: '';
        position: absolute;
        top: 6px; left: 50%;
        transform: translateX(-50%);
        width: 36px; height: 4px;
        border-radius: 2px;
        background: rgba(255,255,255,0.25);
    }

    .rose-messages {
        background: transparent;
        padding: 10px 12px;
        gap: 10px;
    }

    .rose-msg-bubble {
        font-size: 13px;
        line-height: 1.4;
        padding: 8px 12px;
    }

    .rose-message.assistant .rose-msg-bubble {
        background: rgba(255, 255, 255, 0.12);
    }

    .rose-message.user .rose-msg-bubble {
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.35), rgba(68, 160, 141, 0.35));
    }

    .rose-msg-avatar {
        width: 26px; height: 26px;
    }

    .rose-msg-time {
        font-size: 9px;
    }

    .rose-input-area {
        padding: 10px 12px;
        background: rgba(0, 0, 0, 0.6);
        border-top: 1px solid rgba(91, 155, 213, 0.15);
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .rose-input {
        font-size: 16px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255,255,255,0.15);
    }

    .rose-send-btn {
        width: 48px; height: 48px;
        min-width: 48px; min-height: 48px;
        border-radius: 14px;
        font-size: 17px;
    }

    .rose-header-btn {
        width: 40px; height: 40px;
        min-width: 44px; min-height: 44px;
        border-radius: 10px;
    }

    .rose-typing {
        padding: 0 12px 6px;
    }
}
