/* SIMKA V2.0 - Floating AI Bot Assistant Stylesheet */

/* Container Floating Widget */
#simka-ai-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    user-select: none;
    font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Draggable Wrapper & Space Bot Floating Levitation */
.simka-ai-avatar-wrapper {
    position: relative;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: spaceBotHover 3.2s infinite ease-in-out;
}

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

.simka-ai-avatar-wrapper:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Badge "+ GESER" */
.simka-ai-drag-badge {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(255, 75, 43, 0.4);
    margin-bottom: 8px; /* Jarak spasi rapi antara tulisan + GESER dan BOT */
    z-index: 2;
    text-transform: uppercase;
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); box-shadow: 0 6px 15px rgba(255, 75, 43, 0.7); }
}

/* Avatar Robot Icon - Clean Transparent Background (Identik OK_POS) */
.simka-ai-avatar-btn {
    width: 85px;
    height: 85px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: visible;
    position: relative;
    transition: all 0.3s ease;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.simka-ai-avatar-btn:hover {
    transform: translateY(-4px) scale(1.06);
    filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.5));
}

.simka-ai-avatar-btn img {
    width: 85px;
    height: 85px;
    object-fit: contain;
}

/* Animasi Elegan Robot Angkasa Bicara (Digital Soundwave Equalizer & Floating Gestures) */
.simka-ai-avatar-wrapper.speaking .bot-wave-bar {
    animation: soundwaveEqualizer 0.3s infinite ease-in-out alternate !important;
    transform-box: fill-box;
    transform-origin: center;
}

.simka-ai-avatar-wrapper.speaking .bar-1 { animation-delay: 0.05s !important; }
.simka-ai-avatar-wrapper.speaking .bar-2 { animation-delay: 0.15s !important; }
.simka-ai-avatar-wrapper.speaking .bar-3 { animation-delay: 0.02s !important; }
.simka-ai-avatar-wrapper.speaking .bar-4 { animation-delay: 0.20s !important; }
.simka-ai-avatar-wrapper.speaking .bar-5 { animation-delay: 0.08s !important; }

@keyframes soundwaveEqualizer {
    0% { transform: scaleY(0.4); opacity: 0.5; stroke: #38bdf8; }
    50% { transform: scaleY(2.4); opacity: 1; stroke: #60a5fa; }
    100% { transform: scaleY(0.8); opacity: 0.8; stroke: #38bdf8; }
}

.simka-ai-avatar-wrapper.speaking .bot-core-reactor {
    animation: reactorPulse 0.5s infinite ease-in-out alternate !important;
}

@keyframes reactorPulse {
    0% { fill: #38bdf8; }
    100% { fill: #60a5fa; }
}

/* Online Indicator Dot */
.simka-ai-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #00e676;
    border: 2px solid #0b132b;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
}

/* Jendela Chat Window Glassmorphism */
#simka-ai-chat-window {
    position: absolute;
    bottom: 130px;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background: rgba(11, 19, 43, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(75, 107, 251, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(75, 107, 251, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#simka-ai-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.simka-ai-chat-header {
    background: linear-gradient(90deg, #1c2541, #0b132b);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.simka-ai-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.simka-ai-header-icon {
    width: 38px;
    height: 38px;
    background: #4b6bfb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 0 10px rgba(75, 107, 251, 0.6);
}

.simka-ai-header-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.simka-ai-header-subtitle {
    color: #00e676;
    font-size: 11px;
    margin: 0;
}

.simka-ai-voice-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #00e676;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.simka-ai-voice-btn.muted {
    color: #ff4b2b;
    background: rgba(255, 75, 43, 0.15);
}

.simka-ai-voice-btn:hover {
    transform: scale(1.1);
}

.simka-ai-close-btn {
    background: none;
    border: none;
    color: #a0abc0;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.simka-ai-close-btn:hover {
    color: #ffffff;
}

/* Chat Messages Area */
.simka-ai-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Bubble Chat */
.simka-ai-msg {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    animation: fadeInMsg 0.3s ease forwards;
}

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

.simka-ai-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 4px;
}

.simka-ai-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4b6bfb, #3b52c7);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(75, 107, 251, 0.3);
}

/* Quick Action Chips */
.simka-ai-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.simka-ai-chip {
    background: rgba(75, 107, 251, 0.2);
    border: 1px solid rgba(75, 107, 251, 0.4);
    color: #60a5fa;
    font-size: 11.5px;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simka-ai-chip:hover {
    background: #4b6bfb;
    color: #ffffff;
    border-color: #4b6bfb;
}

/* Typing Indicator */
.simka-ai-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    align-self: flex-start;
    width: fit-content;
}

.simka-ai-typing span {
    width: 6px;
    height: 6px;
    background: #60a5fa;
    border-radius: 50%;
    animation: typingBlink 1.4s infinite ease-in-out;
}

.simka-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.simka-ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Chat Input Footer */
.simka-ai-chat-input-area {
    padding: 12px;
    background: rgba(11, 19, 43, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
}

.simka-ai-chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.simka-ai-chat-input-area input:focus {
    border-color: #4b6bfb;
}

.simka-ai-send-btn {
    width: 40px;
    height: 40px;
    background: #4b6bfb;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.simka-ai-send-btn:hover {
    background: #3b52c7;
}

/* Microphone Speech Input Button */
.simka-ai-mic-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #60a5fa;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.simka-ai-mic-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    color: #ffffff;
}

.simka-ai-mic-btn.listening {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #f87171 !important;
    animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

/* Power Off Button in Header */
.simka-ai-power-btn {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    color: #f87171;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.simka-ai-power-btn:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}
