/* ====== LIVE STREAMING STYLES ====== */

/* Live List */
.live-list-container {
    padding: 60px 12px 80px;
    min-height: 100vh;
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.live-header h2 {
    font-size: 22px;
    font-weight: 800;
}

.go-live-btn {
    width: auto;
    padding: 10px 20px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.live-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.live-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.live-thumbnail {
    position: relative;
    aspect-ratio: 9/16;
    background: #000;
    overflow: hidden;
}

.live-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #EF4444;
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

.live-viewers {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.battle-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #EF4444, #3B82F6);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
}

.new-streamer-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--bg-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
}

.live-info {
    padding: 12px;
}

.live-streamer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.streamer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.streamer-name {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vip-badge-mini {
    background: var(--vip-gold);
    color: white;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-size: 8px;
    font-weight: 800;
}

.live-title {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Live Broadcast/Viewer Container */
.live-broadcast-container,
.live-viewer-container {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
}

.live-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.live-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
}

.live-status-badge {
    background: #EF4444;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-viewers-count {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.live-timer {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.end-live-btn, .close-live-btn {
    margin-left: auto;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.close-live-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    font-size: 20px;
}

.streamer-info-bar {
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.streamer-info-bar .streamer-avatar {
    width: 32px;
    height: 32px;
}

.streamer-username {
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.viewer-count-mini {
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.follow-btn-live {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.live-badge-top {
    position: absolute;
    top: 70px;
    left: 16px;
    background: #EF4444;
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.live-title-bar {
    position: absolute;
    top: 110px;
    left: 16px;
    right: 16px;
    z-index: 5;
}

.live-title-bar h3 {
    color: white;
    font-size: 15px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

/* Live Chat */
.live-chat-container {
    position: absolute;
    bottom: 140px;
    left: 0;
    right: 100px;
    max-height: 40vh;
    z-index: 10;
    pointer-events: none;
}

.live-chat-messages {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 100%;
    pointer-events: auto;
}

.live-chat-msg {
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    color: white;
    font-size: 13px;
    max-width: 90%;
    backdrop-filter: blur(10px);
    animation: chatSlide 0.3s ease;
}

@keyframes chatSlide {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.chat-username {
    font-weight: 800;
    margin-right: 6px;
}

.msg-admin {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
}

.msg-vip {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.4), rgba(0, 0, 0, 0.4));
    border: 1px solid gold;
}

.msg-paid {
    background: linear-gradient(90deg, rgba(255, 107, 157, 0.6), rgba(168, 85, 247, 0.6));
}

.msg-mod {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), rgba(0, 0, 0, 0.4));
}

/* Viewer controls */
.viewer-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 15;
}

.live-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    backdrop-filter: blur(10px);
}

.live-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.chat-send-btn, .gift-btn-live, .reaction-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.gift-btn-live {
    background: var(--bg-gradient);
    animation: pulse 2s ease-in-out infinite;
}

.chat-send-btn:active, .gift-btn-live:active, .reaction-btn:active {
    transform: scale(0.9);
}

/* Broadcaster Controls */
.live-broadcaster-controls {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.control-btn:hover {
    background: var(--primary);
}

.control-btn.muted {
    background: #EF4444;
}

/* Live floating reactions */
.floating-effects-live {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}

.live-reaction {
    position: absolute;
    bottom: 100px;
    font-size: 30px;
    animation: reactionFloat 3s ease-out forwards;
}

@keyframes reactionFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    20% {
        transform: translateY(-50px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-500px) scale(0.8) rotate(30deg);
    }
}

/* AR Overlay */
.ar-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15%;
}

.ar-mask {
    font-size: 100px;
    animation: arBounce 2s ease-in-out infinite;
}

@keyframes arBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Gift Notification in Live */
.gift-notification {
    position: absolute;
    left: 16px;
    top: 200px;
    background: linear-gradient(90deg, rgba(255, 107, 157, 0.9), rgba(168, 85, 247, 0.9));
    padding: 8px 16px;
    border-radius: var(--radius-full);
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90%;
    backdrop-filter: blur(10px);
    z-index: 30;
    transition: all 0.5s ease;
}

.gift-notif-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
}

.gift-notif-body {
    flex: 1;
}

.gift-notif-name {
    font-size: 13px;
    font-weight: 800;
}

.gift-notif-action {
    font-size: 11px;
    opacity: 0.9;
}

.gift-notif-icon {
    font-size: 30px;
    animation: giftBounce 1s ease infinite;
}

@keyframes giftBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Effects Panel */
.effects-panel {
    background: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.effects-panel h3 {
    font-size: 15px;
    margin: 16px 0 12px;
}

.effects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.effect-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
}

.effect-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.effect-icon {
    font-size: 32px;
}

.effect-item span {
    font-size: 11px;
    font-weight: 700;
}

/* Leaderboard */
.leaderboard-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.leaderboard-item.top-1 {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: white;
}

.leaderboard-item.top-2 {
    background: linear-gradient(90deg, #C0C0C0, #A0A0A0);
    color: white;
}

.leaderboard-item.top-3 {
    background: linear-gradient(90deg, #CD7F32, #A0522D);
    color: white;
}

.rank {
    font-size: 20px;
    font-weight: 900;
    min-width: 32px;
}

.leaderboard-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.gifter-info {
    flex: 1;
    font-weight: 700;
}

.gift-total {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Live Setup Modal */
.live-setup-modal, .battle-setup-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px 24px;
    max-width: 400px;
    width: 100%;
    position: relative;
}

.live-setup-modal h2, .battle-setup-modal h2 {
    text-align: center;
    margin-bottom: 20px;
}