/* core_app/static/css/chat/lila_stage.css */
/**
 * EK-3 Faz 3: Lila Stage Styling
 * Chat widget üstündeki dinamik panel
 */

.lila-stage {
    position: fixed;
    bottom: 100px;
    /* Chat widget yüksekliği kadar yukarıda başla */
    right: 20px;
    width: 420px;
    max-height: 400px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px 24px 0 0;
    box-shadow:
        0 -10px 40px rgba(139, 92, 246, 0.15),
        0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 9998;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* States */
.lila-stage-hidden {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
}

.lila-stage-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.lila-stage-closing {
    transform: translateY(150%);
    opacity: 0;
}

/* Content container */
.lila-stage-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 400px;
}

/* Header */
.lila-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lila-stage-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.lila-stage-title i {
    font-size: 1.125rem;
    animation: lila-sparkle 2s ease-in-out infinite;
}

@keyframes lila-sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.lila-stage-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lila-stage-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lila-stage-close:active {
    transform: scale(0.95);
}

/* Body */
.lila-stage-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Media container */
.lila-stage-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

/* Lottie */
.lila-lottie-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lila-lottie-container svg {
    max-width: 100%;
    max-height: 300px;
}

/* Image/GIF */
.lila-stage-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
}

/* Video */
.lila-stage-video {
    width: 100%;
    max-height: 300px;
    border-radius: 12px;
}

/* Caption */
.lila-stage-caption {
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid #8b5cf6;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
}

/* Error state */
.lila-stage-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #94a3b8;
}

.lila-stage-error i {
    font-size: 3rem;
}

.lila-stage-error p {
    margin: 0;
    font-size: 0.875rem;
}

/* Loading state */
.lila-stage-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lila-stage-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: lila-stage-spin 0.8s linear infinite;
}

@keyframes lila-stage-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .lila-stage {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 24px 24px 0 0;
    }

    .lila-stage-content {
        max-height: 60vh;
    }

    .lila-stage-header {
        padding: 14px 16px;
    }

    .lila-stage-body {
        padding: 16px;
    }

    .lila-stage-media {
        min-height: 150px;
    }

    .lila-lottie-container svg {
        max-height: 200px;
    }

    .lila-stage-image,
    .lila-stage-video {
        max-height: 200px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .lila-stage {
        width: 380px;
        max-height: 350px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .lila-stage {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: rgba(139, 92, 246, 0.3);
    }

    .lila-stage-media {
        background: #0f172a;
    }

    .lila-stage-caption {
        background: rgba(139, 92, 246, 0.1);
        color: #cbd5e1;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .lila-stage,
    .lila-stage-close,
    .lila-stage-title i {
        animation: none;
        transition: none;
    }
}

/* Print: hide stage */
@media print {
    .lila-stage {
        display: none !important;
    }
}