:root {
    --drami-primary: #7c3aed;
    --drami-secondary: #a78bfa;
    --drami-bg: rgba(10, 10, 18, 0.85);
    /* Darker and more transparent */
    --drami-glass: rgba(255, 255, 255, 0.03);
    --drami-border: rgba(255, 255, 255, 0.08);
}

/* Floating Bubble */
.drami-bubble {
    position: fixed;
    bottom: 80px;
    /* Above mobile nav */
    right: 25px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--drami-primary), var(--drami-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.drami-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.6);
}

.drami-bubble i {
    font-size: 1.8rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.drami-ping {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    background: #10b981;
    border-radius: 50%;
    border: 3px solid #0f0f15;
    animation: dramiPulse 2s infinite;
}

@keyframes dramiPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Chat Window */
.drami-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 600px;
    /* Sightly taller */
    background: var(--drami-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--drami-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

.drami-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.drami-header {
    background: linear-gradient(90deg, var(--drami-primary), var(--drami-secondary));
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.drami-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--drami-primary);
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.drami-header-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.drami-header-info p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.drami-minimize,
.drami-close-permanent {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.drami-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.drami-close-permanent:hover {
    background: #ef4444;
}

.drami-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Messages Area */
.drami-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.drami-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drami-msg.bot {
    background: var(--drami-glass);
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.drami-msg.user {
    background: linear-gradient(135deg, var(--drami-primary), var(--drami-secondary));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* Typing Indicator */
.drami-typing {
    display: flex;
    gap: 4px;
    padding: 12px 18px !important;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Quick Actions */
.drami-actions {
    padding: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.drami-chip {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #a78bfa;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.drami-chip:hover {
    background: var(--drami-primary);
    color: white;
    border-color: var(--drami-primary);
}

/* Input Area */
.drami-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
}

.drami-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(125, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.drami-input:focus {
    border-color: var(--drami-primary);
    background: rgba(255, 255, 255, 0.08);
}

.drami-send {
    width: 45px;
    height: 45px;
    background: var(--drami-primary);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.drami-send:hover {
    background: var(--drami-secondary);
    transform: scale(1.05);
}

/* Suggestion Cards inside chat */
.drami-suggestion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 10px;
    display: flex;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.drami-suggestion-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.drami-suggestion-card img {
    width: 40px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

.drami-suggestion-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.drami-suggestion-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.drami-suggestion-meta {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 480px) {
    .drami-container {
        width: calc(100vw - 40px);
        height: min(500px, 70vh);
        bottom: 80px;
    }

    .drami-bubble {
        bottom: 100px;
        width: 55px;
        height: 55px;
    }
}