/**
 * LA TANDA - MIA Assistant CSS
 * Estilos para el widget flotante de MIA
 * Version: 1.0.0
 */

/* ================================
   WIDGET CONTAINER
   ================================ */
.mia-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Rajdhani', sans-serif;
}

/* ================================
   MINIMIZED STATE
   ================================ */
.mia-widget-minimized {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tanda-cyan), var(--tanda-cyan-light));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mia-widget-minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 255, 255, 0.5);
}

.mia-widget.expanded .mia-widget-minimized,
.mia-widget.minimized .mia-widget-minimized {
    display: none;
}

.mia-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mia-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mia-avatar-fallback {
    width: 100%;
    height: 100%;
    background: var(--tanda-black);
    color: var(--tanda-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.mia-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #22d55e;
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.mia-indicator.active {
    opacity: 1;
    transform: scale(1);
    animation: bounce 1s infinite;
}

/* ================================
   EXPANDED STATE
   ================================ */
.mia-widget-expanded {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

/* ================================
   HEADER
   ================================ */
.mia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(127, 255, 216, 0.05));
    border-bottom: 1px solid var(--border-card);
}

.mia-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mia-avatar-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--tanda-cyan), var(--tanda-cyan-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tanda-black);
    font-size: 16px;
}

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

.mia-name {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--tanda-cyan);
    font-size: 14px;
}

.mia-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.mia-header-actions {
    display: flex;
    gap: 8px;
}

.mia-btn-minimize,
.mia-btn-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-card);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.mia-btn-minimize:hover,
.mia-btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ================================
   BODY
   ================================ */
.mia-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.mia-greeting {
    text-align: center;
    margin-bottom: 20px;
}

.mia-greeting p {
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

/* ================================
   QUICK ACTIONS
   ================================ */
.mia-quick-actions h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.mia-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.mia-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mia-action-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--border-accent);
    color: var(--tanda-cyan);
    transform: translateY(-2px);
}

.mia-action-btn i {
    font-size: 20px;
}

.mia-action-btn span {
    font-size: 12px;
    font-weight: 500;
}

/* ================================
   INPUT AREA
   ================================ */
.mia-input-area {
    display: flex;
    gap: 10px;
}

.mia-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.mia-input:focus {
    outline: none;
    border-color: var(--tanda-cyan);
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
}

.mia-input::placeholder {
    color: var(--text-secondary);
}

.mia-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--tanda-cyan), var(--tanda-cyan-light));
    border: none;
    border-radius: 12px;
    color: var(--tanda-black);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.mia-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
}

/* ================================
   MINIMIZED BAR STATE
   ================================ */
.mia-widget.minimized .mia-widget-expanded {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
    height: 60px;
    overflow: hidden;
}

.mia-widget.minimized .mia-body {
    display: none;
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 480px) {
    .mia-widget {
        bottom: 16px;
        right: 16px;
    }

    .mia-widget-minimized {
        width: 50px;
        height: 50px;
    }

    .mia-avatar {
        width: 40px;
        height: 40px;
    }

    .mia-widget-expanded {
        width: calc(100vw - 32px);
        bottom: 70px;
        right: -8px;
    }

    .mia-body {
        padding: 16px;
        max-height: 350px;
    }

    .mia-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mia-action-btn {
        padding: 12px 8px;
    }

    .mia-action-btn i {
        font-size: 18px;
    }

    .mia-action-btn span {
        font-size: 11px;
    }
}

/* MIA Chat Messages */
.mia-user-msg {
    background: rgba(0, 200, 200, 0.2);
    border-radius: 12px 12px 4px 12px;
    padding: 10px 14px;
    margin: 8px 0;
    margin-left: 20%;
    text-align: right;
}

.mia-assistant-msg {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 12px 4px;
    padding: 10px 14px;
    margin: 8px 0;
    margin-right: 20%;
}

.mia-user-msg p, .mia-assistant-msg p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.mia-greeting {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.mia-greeting::-webkit-scrollbar {
    width: 4px;
}

.mia-greeting::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
