/* 
 * AI Friends CSS
 */

/* Grid and Cards */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.create-card:hover {
    border-color: rgba(129, 140, 248, 0.6) !important;
    background: linear-gradient(135deg, rgba(82, 82, 91, 0.4) 0%, rgba(39, 39, 42, 0.8) 100%) !important;
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.create-card:hover .create-icon {
    transform: scale(1.1);
}
.create-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.existing-card {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.existing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.existing-card img {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.existing-card:hover img {
    transform: scale(1.05);
}

/* Wizard Animations & Effects */
.wizard-container {
    animation: wizUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes wizUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes stepFade {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.hover-border-indigo:hover {
    border-color: #818cf8 !important;
    background: rgba(129, 140, 248, 0.05);
}

.trait-card:has(input:checked) {
    border-color: #818cf8 !important;
    background: rgba(129, 140, 248, 0.1) !important;
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.1);
}

.voice-card:has(input:checked) {
    border-color: #818cf8 !important;
    background: rgba(129, 140, 248, 0.1) !important;
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.1);
}

.voice-card:hover:not(:has(input:checked)) {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.voice-play-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1);
}

.voice-play-btn.playing {
    background: #818cf8 !important;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.6);
}

/* Common form utilities */
.wz-effect-checkbox:checked + .effect-chip {
    border-color: #818cf8;
    color: #818cf8;
}

@media (max-width: 640px) {
    .friends-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .friend-card {
        aspect-ratio: 2/3 !important;
    }
    .friend-card.create-card {
        aspect-ratio: 2/3 !important;
        min-height: 180px;
    }
    .existing-card h3 {
        font-size: 1.1rem !important;
    }
    .existing-card .btn-spring {
        padding: 8px 0 !important;
        font-size: 12px !important;
    }
    .wizard-container {
        height: 100svh;
        max-height: 100svh;
        border-radius: 0;
        border: none;
    }
}


/* ── Avatar Upload Animation ─────────────────────────────────── */
@keyframes spinRing {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

.upload-spinner-ring {
    animation: spinRing 1s linear infinite;
    transform-origin: center;
}

.upload-progress-track {
    width: 100%;
    max-width: 180px;
    height: 4px;
    background: rgba(129, 140, 248, 0.15);
    border-radius: 999px;
    margin: 0 auto;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 55%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(129, 140, 248, 0.6) 30%,
        #818cf8 50%,
        rgba(129, 140, 248, 0.6) 70%,
        transparent 100%
    );
    border-radius: 999px;
    animation: shimmer 1.4s ease-in-out infinite;
}

/* Card locked state while uploading */
.avatar-card-uploading {
    border-color: #818cf8 !important;
    background: rgba(129, 140, 248, 0.07) !important;
    pointer-events: none;
    cursor: default;
}

