/* ==============================================
   CARDS & GRIDS
   - Room Cards
   - Character Marketplace Cards
   - Discovery & Recommendation UI
   ============================================== */

/* Recommendation Visuals */
.character-card.recommended {
    border-color: var(--gold) !important;
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 194, 106, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(243, 194, 106, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(243, 194, 106, 0);
    }
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.character-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.character-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.character-card.selected {
    border-color: var(--gold);
    background: rgba(243, 194, 106, 0.1);
}

.character-card .avatar {
    font-size: 2rem;
    margin-bottom: 8px;
}

.character-card .name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-text-action:hover {
    background: rgba(94, 234, 212, 0.1);
    transform: translateY(-1px);
}

/* Selected Guests List */
.selected-guests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.selected-guest-tag {
    background: linear-gradient(135deg, rgba(243, 194, 106, 0.15) 0%, rgba(243, 194, 106, 0.05) 100%);
    border: 1px solid rgba(243, 194, 106, 0.3);
    border-radius: 50px;
    padding: 6px 14px 6px 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gold);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    animation: slideUpFade 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.selected-guest-tag:hover {
    background: rgba(243, 194, 106, 0.25);
    transform: translateY(-1px);
}

.selected-guest-tag .avatar,
.selected-guest-tag span:first-child {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(243, 194, 106, 0.5);
    overflow: hidden;
    flex-shrink: 0;
}

.guest-chip {
    background: linear-gradient(135deg, rgba(243, 194, 106, 0.15) 0%, rgba(243, 194, 106, 0.05) 100%);
    border: 1px solid rgba(243, 194, 106, 0.3);
    border-radius: 50px;
    padding: 6px 14px 6px 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gold);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.guest-chip .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.selected-guest-tag .remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.selected-guest-tag .remove-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

/* Casting Hall Grid */
.character-marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.casting-card {
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    height: 100%;
    animation: fadeInUp 0.5s ease backwards;
}

.casting-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--gold);
}

.casting-card-inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.casting-avatar {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.casting-avatar .avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
}

.casting-info {
    flex: 1;
}

.casting-info .char-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.casting-info .char-occu {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.casting-info .char-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.char-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.char-stats span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.char-stats span.earnings {
    color: var(--gold);
    font-weight: 700;
}

.casting-card-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: auto;
}

.btn-primary-sm {
    flex: 1;
    background: var(--gold);
    color: #000;
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-primary-sm:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--gold-glow);
}

/* Floating Management Cluster */
.casting-mgmt-floating {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.casting-card:hover .casting-mgmt-floating {
    opacity: 1;
    transform: translateY(0);
}

.casting-edit-btn,
.casting-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.casting-edit-btn:hover {
    background: rgba(243, 194, 106, 0.2);
    color: var(--gold);
    border-color: var(--gold);
    transform: scale(1.15);
    box-shadow: 0 5px 15px var(--gold-glow);
}

.casting-delete-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 5px 15px var(--danger-glow);
}

/* Multi-Persona Discovery UI */
.multi-persona-selector {
    margin-top: 20px;
    padding: 16px;
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 16px;
}

.discovery-header {
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.discovery-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f3e8ff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discovery-title i {
    color: var(--purple);
}

.persona-discovery-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.persona-discovery-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.persona-discovery-card:hover {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateX(4px);
}

.persona-discovery-info h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}