/* Kerjakode Floating CS - Premium Modern Design with Kody Mascot */

.kk-floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000001 !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Chat Preview Bubble */
.kk-chat-preview {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 252, 252, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(13, 148, 137, 0.2);
    border-radius: 20px 20px 20px 4px;
    padding: 12px 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15),
                0 4px 12px rgba(13, 148, 137, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 1);
    animation: chatBubbleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    max-width: 200px;
}

@keyframes chatBubbleIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.kk-chat-preview::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 8px;
    width: 0;
    height: 0;
    border-left: 10px solid rgba(248, 252, 252, 0.95);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

#kkPreviewText {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    display: block;
    animation: textFade 0.3s ease-in-out;
}

@keyframes textFade {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Bubble Button - Premium Glassmorphism with Robot */
.kk-button {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, 
        #0D9489 0%, 
        #14B8A6 50%,
        #0D9489 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite, pulse 2s ease-in-out infinite;
    border: 3px solid rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(13, 148, 137, 0.4),
                0 6px 15px rgba(0, 0, 0, 0.15),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Anime Avatar Icon in Button */
.kk-avatar-icon {
    position: relative;
    width: 40px;
    height: 40px;
    animation: iconFloat 3s ease-in-out infinite;
}

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

.avatar-face-mini {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    position: relative;
    border: 2.5px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                inset 0 2px 8px rgba(255, 255, 255, 0.5);
}

/* Hair/Accessory */
.hair-mini {
    position: absolute;
    width: 20px;
    height: 8px;
    background: #0D9489;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px 10px 0 0;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

.hair-mini::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #14B8A6;
    border-radius: 50%;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
}

/* Eyes */
.eyes-mini {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 16px;
}

.eye-mini {
    width: 7px;
    height: 7px;
    background: #1F2937;
    border-radius: 50%;
    position: relative;
    animation: eyeBlink 4s ease-in-out infinite;
}

@keyframes eyeBlink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.eye-mini::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 1px;
    left: 1px;
}

/* Mouth */
.mouth-mini {
    position: absolute;
    width: 12px;
    height: 6px;
    border: 2px solid #1F2937;
    border-top: none;
    border-radius: 0 0 12px 12px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.kk-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 137, 0.4) 0%, transparent 70%);
    animation: pulse-ring 2.5s ease-out infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.kk-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 16px 45px rgba(13, 148, 137, 0.5),
                0 8px 20px rgba(0, 0, 0, 0.2),
                inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

/* Chat Box - Premium Card Design */
.kk-box {
    width: 360px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 252, 252, 0.95) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
                0 10px 30px rgba(13, 148, 137, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 1);
    overflow: hidden;
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000000;
}

.kk-box.active {
    display: block;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Header - Gradient Premium */
.kk-header {
    background: linear-gradient(135deg, 
        #0D9489 0%, 
        #14B8A6 50%,
        #0D9489 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(13, 148, 137, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

.kk-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%);
}

.kk-header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kk-header strong {
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Online Badge */
.kk-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    width: fit-content;
}

.kk-online-dot {
    width: 7px;
    height: 7px;
    background: #4ADE80;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3),
                0 0 8px rgba(74, 222, 128, 0.6);
    animation: onlinePulse 2s ease-in-out infinite;
}

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

#kkClose {
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: all 0.3s ease;
    opacity: 0.9;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

#kkClose:hover {
    transform: rotate(90deg) scale(1.1);
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}

/* Body - Premium Layout */
.kk-body {
    padding: 24px 20px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(240, 253, 250, 0.4) 100%);
}

/* Greeting - Enhanced */
.kk-greet {
    font-size: 15px;
    margin-bottom: 18px;
    color: #1F2937;
    line-height: 1.7;
    text-align: center;
    font-weight: 500;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(13, 148, 137, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Wave Hand Animation */
.wave-hand {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(14deg); }
    50% { transform: rotate(-4deg); }
    60% { transform: rotate(10deg); }
    70%, 100% { transform: rotate(0deg); }
}

/* Options - Premium Cards */
.kk-option {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(242, 247, 255, 0.7) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1.5px solid rgba(13, 148, 137, 0.15);
    border-radius: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14.5px;
    font-weight: 600;
    color: #374151;
    text-align: left;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.kk-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(13, 148, 137, 0.1) 50%,
        transparent 100%);
    transition: left 0.5s ease;
}

.kk-option:hover::before {
    left: 100%;
}

.kk-option:hover {
    background: linear-gradient(135deg, #0D9489 0%, #14B8A6 100%);
    color: white;
    transform: translateX(4px) translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 148, 137, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main WA Button - Premium */
.kk-wa-main {
    display: block;
    margin-top: 12px;
    text-align: center;
    background: linear-gradient(135deg, 
        #25D366 0%, 
        #20BA5A 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 15px;
    border-radius: 14px;
    color: white;
    font-weight: 700;
    text-decoration: none;
    font-size: 15.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.kk-wa-main::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.kk-wa-main:hover::before {
    width: 300px;
    height: 300px;
}

.kk-wa-main:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .kk-floating {
        right: 16px;
        bottom: 16px;
        gap: 10px;
    }
    
    .kk-chat-preview {
        max-width: 180px;
        padding: 10px 14px;
    }
    
    #kkPreviewText {
        font-size: 13px;
    }
    
    .kk-box {
        width: calc(100vw - 32px);
        max-width: 360px;
    }
    
    .kk-button {
        width: 60px;
        height: 60px;
    }
    
    .kk-avatar-icon {
        width: 38px;
        height: 38px;
    }
    
    .avatar-face-mini {
        width: 38px;
        height: 38px;
    }
    
    .hair-mini {
        width: 28px;
        height: 14px;
    }
    
    .eyes-mini {
        gap: 10px;
        padding-top: 16px;
    }
    
    .eye-mini {
        width: 6px;
        height: 8px;
    }
    
    .mouth-mini {
        width: 12px;
        height: 7px;
        bottom: 9px;
    }
}

@media (max-width: 480px) {
    .kk-floating {
        right: 12px;
        bottom: 12px;
        gap: 8px;
    }
    
    .kk-chat-preview {
        max-width: 150px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .kk-button {
        width: 56px;
        height: 56px;
    }
    
    .kk-box {
        border-radius: 20px;
    }
    
    .kk-header {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .kk-online-badge {
        font-size: 10px;
        padding: 2px 8px;
        gap: 5px;
    }
    
    .kk-online-dot {
        width: 6px;
        height: 6px;
    }
    
    .kk-body {
        padding: 16px;
    }
    
    .kk-greet {
        font-size: 14px;
        padding: 10px 14px;
        margin-bottom: 14px;
    }
    
    .kk-option {
        padding: 11px 13px;
        font-size: 13.5px;
        margin-bottom: 10px;
    }
    
    .kk-wa-main {
        padding: 11px 13px;
        font-size: 14.5px;
    }
}
