/* ====================================
   PREMIUM LIVE SIMULATOR - CSS
   Modern, Glassmorphism, Vibrant
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: white;
    overflow: hidden;
}

/* ====== PARTICLE CANVAS ====== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ====== GLASSMORPHISM EFFECT ====== */
.glass-effect {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ====== MAIN LAYOUT ====== */
.main-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* ====== VIDEO SECTION ====== */
.video-section {
    flex: 3;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.05) contrast(1.1);
}

/* ====== VIDEO HEADER ====== */
.video-header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.header-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.live-badge {
    background: linear-gradient(135deg, #ff0844, #ff4b5c);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.4);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 8, 68, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 8, 68, 0.7);
    }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.viewers,
.stream-quality {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.viewers:hover,
.stream-quality:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* ====== STATS PANEL ====== */
.stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 16px;
    border-radius: 16px;
    min-width: 200px;
    z-index: 100;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.stat-item+.stat-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.stat-item i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffd89b, #19547b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ====== GOAL CONTAINER ====== */
.goal-container {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: 20px;
    min-width: 300px;
    z-index: 100;
}

.goal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.goal-icon {
    font-size: 1.2rem;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c6ff, #0072ff, #9C27B0);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
    transition: width 0.5s ease;
    border-radius: 14px;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ====== VIDEO CONTROLS ====== */
.video-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.btn-control {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-control:active {
    transform: translateY(-1px) scale(0.98);
}

/* ====== REACTION PANEL ====== */
.reaction-panel {
    position: absolute;
    bottom: 150px;
    right: 20px;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.reaction-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.15) rotate(5deg);
}

.reaction-btn:active {
    transform: scale(1.3) rotate(0deg);
    animation: reaction-pulse 0.4s ease;
}

@keyframes reaction-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* ====== CHAT SECTION ====== */
.chat-section {
    flex: 1;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header {
    padding: 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 10px #00ff88;
}

.menu-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ====== CHAT MESSAGES ====== */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.msg {
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    animation: slideInChat 0.4s ease;
    word-wrap: break-word;
}

@keyframes slideInChat {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.username {
    font-weight: 700;
    margin-right: 6px;
}

.text {
    color: #e0e0e0;
}

.msg.tip {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
    border-left: 4px solid #FFD700;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    animation: tipGlow 0.6s ease;
}

@keyframes tipGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 215, 0, 0.5);
    }
}

.msg.tip .username {
    color: #FFD700;
    font-size: 1rem;
}

.msg.system {
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: #ff6b6b;
    font-style: italic;
    font-size: 0.85rem;
    text-align: center;
    padding: 10px;
}

/* ====== CHAT INPUT ====== */
.chat-input-area {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-area input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    color: white;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chat-input-area input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.chat-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.emoji-btn,
.send-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover,
.send-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.send-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* ====== NOTIFICATIONS ====== */
#notificationContainer {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 140, 0, 0.95));
    backdrop-filter: blur(20px);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4);
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    animation: notificationSlide 0.5s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ====== FLOATING EMOJIS ====== */
#floatingEmojiContainer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 75%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.floating-emoji {
    position: absolute;
    font-size: 2.5rem;
    animation: floatUp 3s ease-out forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-600px) rotate(360deg) scale(1.5);
    }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .video-section {
        height: 55vh;
    }

    .chat-section {
        height: 45vh;
    }

    .stats-panel {
        top: auto;
        bottom: 100px;
        right: 10px;
        font-size: 0.8rem;
        min-width: 150px;
    }

    .goal-container {
        bottom: 70px;
        min-width: 250px;
    }

    .reaction-panel {
        flex-direction: row;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
}