/* AI Personas Module Styles */

/* Wizard animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wizard-step {
    animation: slideInRight 0.3s ease;
}

/* Avatar selection grid */
.avatar-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-option:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.avatar-option.selected {
    animation: scaleIn 0.3s ease;
}

/* Persona card animations */
.persona-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.persona-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 3D Carousel styles */
.ai-carousel-container {
    position: relative;
    height: 300px;
    perspective: 1000px;
    overflow: hidden;
    margin: 20px 0;
}

.ai-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150px;
    height: 200px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backface-visibility: hidden;
}

.carousel-item:hover {
    transform: translate(-50%, -50%) rotateY(var(--rotation)) translateZ(270px) scale(1.1);
}

.carousel-item > div {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    color: var(--tg-theme-text-color, #ffffff);
}

.carousel-item:hover > div {
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

/* Carousel controls */
.ai-carousel-container button {
    transition: all 0.2s ease;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.ai-carousel-container button:hover {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(1.1);
}

.ai-carousel-container button:active {
    transform: translateY(-50%) scale(0.95);
}

/* Context menu */
#persona-context-menu {
    animation: scaleIn 0.2s ease;
}

#persona-context-menu button:hover {
    background: rgba(0,0,0,0.05);
}

/* Modal animations */
.modal-overlay {
    animation: fadeIn 0.3s ease;
}

.modal-container {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading state */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Shimmer effect for loading avatars */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button animations */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Icon button */
.icon-button {
    transition: all 0.2s ease;
}

.icon-button:hover {
    transform: rotate(90deg);
}

/* Empty state animation */
.empty-state {
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    animation: fadeIn 0.5s ease 0.2s both;
}

.empty-text {
    animation: fadeIn 0.5s ease 0.4s both;
}

/* Responsive design */
@media (max-width: 768px) {
    .ai-carousel-container {
        height: 250px;
    }
    
    .carousel-item {
        width: 120px;
        height: 160px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .carousel-item > div {
        background: rgba(42, 42, 42, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    #persona-context-menu {
        background: #2a2a2a;
        color: #ffffff;
    }
}

/* Accessibility */
.carousel-item:focus {
    outline: 2px solid var(--tg-theme-button-color, #2E4B8E);
    outline-offset: 4px;
}

/* Smooth scrolling for modals */
.modal-body {
    scroll-behavior: smooth;
}

/* Grid layout for persona list */
@media (min-width: 768px) {
    .personas-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }
}
