/* ============================================
   Live Stream — Light theme (template 1)
   ============================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #22c55e;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}

body.live-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-900);
}
.nav-brand img.site-logo {
    max-height: 36px;
    width: auto;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-600);
    font-size: .9rem;
}
.nav-user strong {
    color: var(--gray-900);
}

/* Live layout */
.live-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}
.live-layout.style2 {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    height: calc(100vh - 80px);
}

/* Stream wrapper */
.stream-wrapper {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.stream-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0,0,0,.8);
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--danger);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}
.stream-header h1 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}
.iframe-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    flex: 1;
}
.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Chat panel */
.chat-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    height: 100%;
}
.chat-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.chat-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-loading {
    text-align: center;
    color: var(--gray-400);
    padding: 20px;
    font-size: .9rem;
}
.chat-msg {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--gray-50);
    max-width: 90%;
}
.chat-msg-me {
    background: #ede9fe;
    align-self: flex-end;
}
.chat-msg-name {
    font-size: .75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}
.chat-msg-me .chat-msg-name {
    color: var(--primary-dark);
}
.chat-msg-text {
    font-size: .9rem;
    color: var(--gray-800);
    word-break: break-word;
}
.chat-msg-time {
    font-size: .7rem;
    color: var(--gray-400);
    margin-top: 4px;
    text-align: right;
}

/* Chat input */
.chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.chat-input-row input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .9rem;
    outline: none;
}
.chat-input-row input[type="text"]:focus {
    border-color: var(--primary);
}
.btn-chat-send {
    padding: 10px 20px;
    font-size: .9rem;
}
.chat-error {
    color: var(--danger);
    font-size: .8rem;
    margin-top: 4px;
    min-height: 18px;
}

/* Emoji wrapper */
.emoji-wrapper {
    position: relative;
}
.emoji-trigger {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background .15s;
}
.emoji-trigger:hover {
    background: var(--gray-200);
}
.emoji-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 320px;
    max-height: 280px;
    overflow: hidden;
    z-index: 200;
    margin-bottom: 8px;
}
.emoji-picker.open {
    display: block;
}
.emoji-picker-search input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--gray-200);
    font-size: .85rem;
    outline: none;
}
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.emoji-picker-grid button {
    background: none;
    border: none;
    font-size: 1.3rem;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background .1s;
}
.emoji-picker-grid button:hover {
    background: var(--gray-100);
}

/* Coming Soon / Countdown */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}
.coming-soon-icon {
    font-size: 5rem;
    margin-bottom: 16px;
}
.coming-soon h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.coming-soon p {
    color: var(--gray-500);
    font-size: 1.1rem;
    margin-bottom: 24px;
}
.countdown-box {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}
.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 80px;
}
.countdown-item span {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.countdown-item label {
    font-size: .75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
}
.start-time {
    color: var(--gray-500);
    font-size: .95rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
}
.btn-sm {
    padding: 6px 14px;
    font-size: .8rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 900px) {
    .live-layout.style2 {
        grid-template-columns: 1fr;
        height: auto;
    }
    .stream-wrapper {
        height: auto;
    }
    .chat-panel {
        height: 500px;
    }
}
@media (max-width: 600px) {
    .countdown-box {
        gap: 8px;
    }
    .countdown-item {
        padding: 10px 14px;
        min-width: 60px;
    }
    .countdown-item span {
        font-size: 1.75rem;
    }
}
