/* ==============================================
   COMPONENTS - SHARED UI PRIMITIVES
   ============================================== */

.character-card {
    flex: 0 0 auto;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.character-card:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.character-card.selected {
    opacity: 1;
    transform: scale(1.05);
}

.character-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.character-card.selected .avatar {
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.character-card .char-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.character-card.selected .char-name {
    color: var(--cyan);
    font-weight: 500;
}

/* ==============================================
   AVATAR ASSETS
   ============================================== */

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.room-category .avatar-img {
    width: 18px;
    height: 18px;
    margin-right: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message .avatar .avatar-img {
    border-radius: 12px;
}

.participant .avatar-img {
    border-radius: 50%;
}

/* User Profile & Auth Primitives */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 12px 4px 4px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #151518;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 140px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1001;
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Modal Overlay & Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.premium-select-sm {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px !important;
}

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

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.stat-item.duration {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item.duration i {
    font-size: 0.7rem;
    color: var(--cyan);
    opacity: 0.8;
}

.stat-item i {
    font-size: 0.8rem;
}

.room-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.room-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.room-action-btn:active {
    transform: translateY(0);
}

.share-btn:hover {
    color: #10b981;
}

/* Like/Dislike/Save */
.like-btn:hover {
    color: var(--gold);
}

.dislike-btn:hover {
    color: #f43f5e;
}

.save-btn:hover {
    color: #3b82f6;
}

/* Share Modal & Grid */
.share-modal-compact {
    max-width: 360px;
    width: 90%;
    padding: 24px !important;
    border-radius: 28px !important;
}

/* Unmute Indicator (YouTube Style) */
.unmute-indicator {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(243, 194, 106, 0.95);
    color: #000;
    padding: 10px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 5000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: slideInDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.unmute-indicator:hover {
    transform: translateX(-50%) scale(1.05);
}

.unmute-indicator.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.autoplay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: white;
    font-weight: 600;
}

.play-pulse-btn {
    width: 80px;
    height: 80px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: black;
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(184, 134, 11, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(184, 134, 11, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(184, 134, 11, 0);
    }
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 0 10px;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 8px;
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.social-btn i {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.social-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.2s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    color: white;
}

.social-btn:hover i {
    transform: scale(1.1);
}

/* Social Platform Colors */
.social-btn.wechat:hover {
    color: #07C160;
    border-color: #07C160;
}

.social-btn.whatsapp:hover {
    color: #25D366;
    border-color: #25D366;
}

.social-btn.discord:hover {
    color: #5865F2;
    border-color: #5865F2;
}

.social-btn.youtube:hover {
    color: #FF0000;
    border-color: #FF0000;
}

.social-btn.x-twitter:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.social-btn.facebook:hover {
    color: #1877F2;
    border-color: #1877F2;
}

.social-btn.linkedin:hover {
    color: #0A66C2;
    border-color: #0A66C2;
}

.social-btn.reddit:hover {
    color: #FF4500;
    border-color: #FF4500;
}

.social-btn.pinterest:hover {
    color: #BD081C;
    border-color: #BD081C;
}

.social-btn.redbook:hover {
    color: #FF2442;
    border-color: #FF2442;
}

.social-btn.email:hover {
    color: #EA4335;
    border-color: #EA4335;
}

.social-btn.copy:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* Replay Player Interactions */
.player-interactions {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    padding-bottom: 20px;
}

.player-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-action-btn:hover {
    color: white;
    transform: scale(1.1);
}

.player-action-btn:active {
    transform: scale(0.95);
}

#playerShareBtn:hover {
    color: #10b981;
}

#playerLikeBtn:hover {
    color: var(--gold);
}

#playerDislikeBtn:hover {
    color: #f43f5e;
}

#playerSaveBtn:hover {
    color: #3b82f6;
}

.player-action-btn.active {
    opacity: 1;
}

/* Room More Menu */
.room-more-menu {
    position: fixed;
    /* Matches JS */
    background: rgba(25, 25, 30, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    animation: menu-slide-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menu-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.room-more-item {
    background: none;
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    width: 120px;
    text-align: left;
}

.room-more-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.room-more-item i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.room-action-btn.more-btn {
    opacity: 0.6;
}

.room-action-btn.more-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}