/* Mia AI Assistant - Video Avatar Version */

#miaContainer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================
   INTRO OVERLAY
   ========================================== */

.mia-intro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.mia-intro-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mia-intro-overlay.hidden {
    display: none !important;
}

.mia-intro-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mia-intro-content.visible {
    transform: scale(1);
    opacity: 1;
}

.mia-intro-content.shrinking {
    transform: scale(0.08) translateX(calc(50vw - 50px)) translateY(calc(50vh - 50px));
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mia-intro-video {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ff69b4;
    box-shadow: 
        0 0 60px rgba(255, 105, 180, 0.6),
        0 0 120px rgba(255, 105, 180, 0.3);
    animation: introGlow 2s ease-in-out infinite;
}

@keyframes introGlow {
    0%, 100% { box-shadow: 0 0 60px rgba(255, 105, 180, 0.6), 0 0 120px rgba(255, 105, 180, 0.3); }
    50% { box-shadow: 0 0 80px rgba(255, 105, 180, 0.8), 0 0 150px rgba(255, 105, 180, 0.4); }
}

.mia-intro-text {
    margin-top: 25px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.3s;
}

.mia-intro-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.mia-intro-greeting {
    display: block;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 8px;
}

.mia-intro-name {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff69b4, #ff1493, #ff69b4);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 3s linear infinite;
}

@keyframes textShine {
    to { background-position: 200% center; }
}

.mia-intro-overlay::after {
    content: 'Atlamak için tıklayın';
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    opacity: 0;
    animation: fadeIn 1s ease 2.5s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ==========================================
   CHAT WIDGET
   ========================================== */

.mia-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mia-widget.visible {
    opacity: 1;
    visibility: visible;
}

/* Toggle Button - VIDEO */
.mia-toggle {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 3px solid #ff69b4;
    background: #000;
    cursor: pointer;
    box-shadow: 0 5px 30px rgba(255, 105, 180, 0.5);
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    overflow: hidden;
    transform: scale(0);
}

.mia-toggle.appear {
    transform: scale(1);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mia-toggle.hidden {
    transform: scale(0) !important;
    opacity: 0;
    pointer-events: none;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.mia-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 40px rgba(255, 105, 180, 0.6);
}

.mia-toggle.hidden:hover {
    transform: scale(0) !important;
}

.mia-toggle-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.mia-pulse {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid #ff69b4;
    animation: pulse 2s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.35); opacity: 0; }
}

.mia-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff1493;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid #fff;
    animation: badgePop 2s infinite;
    z-index: 2;
}

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

/* Chat Window */
.mia-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 370px;
    height: 520px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 15px 50px rgba(255, 105, 180, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.mia-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.mia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
}

.mia-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mia-avatar-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mia-header-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mia-info {
    display: flex;
    flex-direction: column;
}

.mia-name {
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
}

.mia-status {
    color: rgba(255,255,255,0.9);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mia-status i {
    color: #00ff88;
    font-size: 7px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.mia-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.mia-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Messages */
.mia-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: linear-gradient(180deg, #fff8fa 0%, #fff 100%);
}

.mia-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    animation: msgIn 0.35s ease;
}

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

.mia-msg.user {
    flex-direction: row-reverse;
}

.msg-avatar-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #ffb6c1;
}

.msg-avatar-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.mia-msg.bot .msg-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #ffe0ec;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.08);
}

.mia-msg.user .msg-bubble {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.25);
}

.msg-bubble p {
    margin: 0 0 4px;
}

.msg-bubble p:last-child {
    margin: 0;
}

.msg-bubble strong {
    color: #ff1493;
}

.mia-msg.user .msg-bubble strong {
    color: #fff;
}

.msg-link {
    display: inline-block;
    color: #ff1493;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 5px;
    text-decoration: none;
}

.msg-link:hover {
    text-decoration: underline;
}

/* Typing */
.msg-bubble.typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.msg-bubble.typing span {
    width: 8px;
    height: 8px;
    background: #ffb6c1;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); background: #ffb6c1; }
    50% { transform: translateY(-6px); background: #ff69b4; }
}

/* Quick Buttons */
.mia-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #ffe0ec;
}

.mia-quick button {
    background: linear-gradient(135deg, #fff8fa, #ffe8ef);
    border: 1px solid #ffb6c1;
    color: #ff1493;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.25s;
    font-weight: 500;
}

.mia-quick button:hover {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Input */
.mia-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #ffe0ec;
}

.mia-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ffb6c1;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
    background: #fff8fa;
}

.mia-input input:focus {
    border-color: #ff69b4;
    background: #fff;
}

.mia-input input::placeholder {
    color: #ccc;
}

.mia-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.mia-input button:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

/* Scrollbar */
.mia-messages::-webkit-scrollbar {
    width: 5px;
}

.mia-messages::-webkit-scrollbar-thumb {
    background: #ffb6c1;
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 480px) {
    .mia-intro-video {
        width: 220px;
        height: 220px;
    }
    
    .mia-intro-greeting { font-size: 1.4rem; }
    .mia-intro-name { font-size: 2rem; }
    
    .mia-widget {
        bottom: 12px;
        right: 12px;
    }
    
    .mia-toggle {
        width: 60px;
        height: 60px;
    }
    
    .mia-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
