﻿/* =======================================================
   길동무 AI 로봇 전용 CSS 모듈 (ccaicode.pages.dev)
======================================================= */
:root {
    --gai-record-color: #ef4444; 
    --gai-success-color: #4ade80;
    --gai-heart-pink: #ec4899; 
}

/* 로봇 기본 형태 */
.robot-face {
    width: 100%; height: 100%;
    border-radius: 50% 50% 20% 20% / 50% 50% 25% 25%; 
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 4px solid rgba(56, 189, 248, 0.6); 
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 0 20px rgba(56, 189, 248, 0.4);
    display: flex; 
    position: relative;
    overflow: hidden;
    transition: transform 2.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 1.5s ease-in-out, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.robot-inner-face {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%; transition: transform 0.4s ease-in-out; position: relative; 
}

.robot-ear {
    position: absolute; left: -2px; top: 38%; width: 18%; height: 26%;
    background: #3b82f6; border-radius: 0 20px 20px 0; 
    opacity: 0; transform: translateX(-100%); transition: all 0.4s ease-in-out;
    box-shadow: 0 0 10px rgba(0,0,0,0.5); z-index: -1; display: flex; align-items: center;
}
.robot-ear::after {
    content: ''; width: 40%; height: 45%; border-right: 3px solid rgba(0, 0, 0, 0.25); border-radius: 0 10px 10px 0;
}

.robot-eyes { display: flex; gap: 20%; width: 100%; justify-content: center; margin-bottom: 5%; }

.robot-eye {
    width: 15%; height: 35px; background: #38bdf8; border-radius: 20px;
    box-shadow: 0 0 15px #38bdf8; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: visible; 
}

.pupil {
    position: absolute; width: 12px; height: 12px; background: #0f172a; 
    border-radius: 50%; top: 6px; right: 6px; transition: all 0.3s ease; z-index: 2;
}

.robot-mouth { width: 30%; height: 10px; background: transparent; transition: all 0.3s ease; }

.musical-notes {
    position: absolute; top: 10%; right: 15%;
    display: none; z-index: 20;
}
.note1, .note2 { position: absolute; font-size: 3rem; opacity: 0; }
.note1 { color: #facc15; text-shadow: 0 0 5px #ca8a04; animation: floatNote 2s infinite ease-out; }
.note2 { color: #38bdf8; text-shadow: 0 0 5px #0284c7; animation: floatNote 2s infinite ease-out 1s; left: -25px; top: 20px; font-size: 2.4rem; }
@keyframes floatNote {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { transform: translate(15px, -25px) scale(1.2) rotate(20deg); opacity: 0; }
}

/* ==============================================
   감정 및 상태별 CSS
============================================== */
.robot-face.idle-smile .robot-mouth { border-bottom: 4px solid #38bdf8; border-radius: 0 0 50px 50px; }
.robot-face.idle-smile .pupil { top: 10px; right: 10px; } 

.robot-face.idle-wink .robot-mouth { border-bottom: 4px solid #38bdf8; border-radius: 0 0 50px 50px; transform: rotate(10deg); }
.robot-face.idle-wink .left-eye { height: 35px; overflow: hidden; }
.robot-face.idle-wink .right-eye { height: 5px; border-radius: 3px; transform: translateY(15px); overflow: hidden; }
.robot-face.idle-wink .right-eye .pupil { opacity: 0; } 

.robot-face.idle-sing .robot-eye { height: 25px; overflow: hidden; } 
.robot-face.idle-sing .pupil { top: 6px; right: 50%; transform: translateX(50%); } 
.robot-face.idle-sing .robot-mouth { width: 15px; height: 20px; background: #38bdf8; border-radius: 50%; border: none; }
.robot-face.idle-sing .musical-notes { display: block; } 

.robot-face.idle-think .robot-eye { height: 35px; overflow: hidden; }
.robot-face.idle-think .pupil { top: 2px; right: 4px; } 
.robot-face.idle-think .robot-mouth { width: 18px; height: 4px; background: #38bdf8; border-radius: 2px; border: none; transform: translate(5px, 5px) rotate(15deg); }

.robot-face.idle-heart .robot-eye { background: transparent; box-shadow: none; overflow: visible; }
.robot-face.idle-heart .robot-eye::before, .robot-face.idle-heart .robot-eye::after {
    content: ''; position: absolute; width: 20px; height: 32px; 
    background: var(--gai-heart-pink); 
    border-radius: 20px 20px 0 0; top: 0; filter: drop-shadow(0 0 5px var(--gai-heart-pink));
}
.robot-face.idle-heart .left-eye::before, .robot-face.idle-heart .right-eye::before { transform: rotate(-45deg); left: -5px; transform-origin: 0 100%; }
.robot-face.idle-heart .left-eye::after, .robot-face.idle-heart .right-eye::after { transform: rotate(45deg); left: 15px; transform-origin: 100% 100%; }
.robot-face.idle-heart .pupil { opacity: 0; } 
.robot-face.idle-heart .robot-mouth { border-bottom: 5px solid var(--gai-heart-pink); border-radius: 0 0 50px 50px; width: 40%; } 

.robot-face.idle-kiss .robot-mouth {
    width: 15px; height: 15px; background: transparent;
    border: 4px solid var(--gai-heart-pink); border-radius: 50%; 
    box-shadow: 0 0 10px var(--gai-heart-pink); animation: kissPucker 0.5s ease-in-out;
}
@keyframes kissPucker { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.robot-face.idle-kiss .robot-eye { height: 5px; background: #38bdf8; border-radius: 3px; transform: translateY(15px); overflow: hidden; }
.robot-face.idle-kiss .left-eye { transform: translateY(15px) rotate(15deg); }
.robot-face.idle-kiss .right-eye { transform: translateY(15px) rotate(-15deg); }
.robot-face.idle-kiss .pupil { opacity: 0; }

.robot-face.idle-cute .robot-eye { background: transparent; box-shadow: none; overflow: visible; }
.robot-face.idle-cute .robot-eye::before {
    content: '♥'; position: absolute; font-size: 3rem; 
    color: var(--gai-heart-pink); 
    top: -5px; left: 0; filter: drop-shadow(0 0 5px var(--gai-heart-pink));
}
.robot-face.idle-cute .pupil { opacity: 0; }
.robot-face.idle-cute .robot-mouth { width: 15px; height: 15px; background: #38bdf8; border-radius: 50%; border: none; animation: cutePucker 1s ease-in-out infinite; }
@keyframes cutePucker { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.robot-face.idle-cute .robot-inner-face::before, .robot-face.idle-cute .robot-inner-face::after {
    content: ''; position: absolute; width: 14vmin; height: 14vmin; background: rgba(59, 130, 246, 0.4); border-radius: 50%; filter: blur(5px); top: 50%; z-index: -1;
}
.robot-face.idle-cute .robot-inner-face::before { left: 15%; }
.robot-face.idle-cute .robot-inner-face::after { right: 15%; }

/* (시스템 상태) 녹음 중 */
@keyframes tilt-head { 0% { transform: rotate(0deg); } 50% { transform: rotate(15deg); } 100% { transform: rotate(0deg); } }
.robot-face.listening {
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 0 30px rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.8); 
    animation: tilt-head 2s infinite ease-in-out; 
}
.robot-face.listening .robot-inner-face { transform: translateX(18%); }
.robot-face.listening .robot-ear { opacity: 1; transform: translateX(0); background: #f87171; box-shadow: 0 0 20px #f87171; }
.robot-face.listening .robot-ear::after { border-right: 3px solid rgba(153, 27, 27, 0.4); }
.robot-face.listening .robot-eye { background: #f87171; box-shadow: 0 0 20px #f87171; height: 28px; width: 28px; border-radius: 50%; overflow: hidden; }
.robot-face.listening .pupil { width: 14px; height: 14px; top: 50%; right: 50%; transform: translate(50%, -50%); }
.robot-face.listening .robot-mouth { width: 15px; height: 15px; background: transparent; border: 4px solid #f87171; border-radius: 50%; }

/* (시스템 상태) 검색 성공 */
.robot-face.success { border-color: rgba(74, 222, 128, 0.8); }
.robot-face.success .robot-eye { height: 18px; border-radius: 50px 50px 0 0; background: var(--gai-success-color); box-shadow: 0 0 15px var(--gai-success-color); overflow: hidden; }
.robot-face.success .pupil { opacity: 0; } 
.robot-face.success .robot-mouth { width: 40%; height: 18px; background: transparent; border-bottom: 6px solid var(--gai-success-color); border-radius: 0 0 50px 50px; }

/* (시스템 상태) 에러 */
.robot-face.error { border-color: rgba(14, 165, 233, 0.8); }
.robot-face.error .robot-eye { height: 15px; border-radius: 20px 20px 0 0; border-bottom: 5px solid #0ea5e9; background: #38bdf8; overflow: visible; }
.robot-face.error .pupil { top: 2px; right: 50%; transform: translateX(50%); width: 8px; height: 8px; } 
.robot-face.error .robot-mouth { border-top: 4px solid #38bdf8; border-bottom: none; border-radius: 50px 50px 0 0; margin-top: 5px; background: transparent; }
.tear { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); width: 6px; height: 12px; background: #0ea5e9; border-radius: 50%; opacity: 0; display: none; }
.robot-face.error .tear { display: block; animation: crying 1.2s infinite; }
@keyframes crying { 0% { opacity: 1; transform: translate(-50%, 0px); } 100% { opacity: 0; transform: translate(-50%, 25px); } }
