@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-main: #0F0F13;
    --bg-secondary: #1C1C24;
    --primary-color: #8A2BE2;
    --accent-color: #00F0FF;
    --text-light: #FFFFFF;
    --text-muted: #A0A0B0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-light);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: relative;
}

/* ==================================
   Gerenciamento de Telas (SPA)
================================== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    background-color: var(--bg-main);
}

.screen.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
    z-index: 2;
}

/* ==================================
   TELA INICIAL
================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-main);
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn.highlight {
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 80px 20px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.room-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    cursor: pointer;
}

.room-thumb {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.platform-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
}
.platform-badge.youtube { background: #FF0000; color: white; }
.platform-badge.netflix { background: #E50914; color: white; }

.viewer-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    backdrop-filter: blur(4px);
}

.room-info {
    padding: 15px;
}
.room-info h3 { font-size: 16px; margin-bottom: 4px; }
.room-info p { font-size: 13px; color: var(--text-muted); }

/* Menu Inferior */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 65px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 20;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    gap: 4px;
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--primary-color); }

/* ==================================
   TELA DA SALA (PLAYER E CHAT)
================================== */
#room-screen {
    background: #000;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.room-title {
    font-size: 14px;
    font-weight: 600;
}

.video-container {
    width: 100%;
    height: 35vh;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder {
    color: var(--text-muted);
    text-align: center;
}
.video-placeholder i { font-size: 40px; margin-bottom: 8px; }

#room-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    border: none;
}

/* Área Social */
.social-container {
    flex: 1;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    border-radius: 20px 20px 0 0;
    margin-top: -15px;
    z-index: 5;
    overflow: hidden;
}

.participants {
    display: flex;
    gap: 10px;
    padding: 15px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}
.participants::-webkit-scrollbar { display: none; }

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.speaking {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
.invite-btn { border: 1px dashed var(--text-muted); color: var(--text-muted); cursor: pointer; }

.chat-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.message.system { align-self: center; background: rgba(255,255,255,0.1); font-size: 12px; border-radius: 20px; color: var(--text-muted); }
.message.received { align-self: flex-start; background: var(--bg-secondary); border-bottom-left-radius: 4px; }
.message.sent { align-self: flex-end; background: var(--primary-color); border-bottom-right-radius: 4px; }

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    gap: 10px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
}

.chat-input-area input {
    flex: 1;
    background: #2A2A35;
    border: none;
    color: white;
    padding: 12px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.mic-btn { color: #FF4444; }
.send-btn { color: var(--accent-color); }

/* ==================================
   MODAL CRIAR SALA (BOTTOM SHEET)
================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.platform-grid {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    transition: 0.2s;
}
.platform-btn.selecionada { color: var(--text-light); font-weight: bold; }

.plat-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    background: #2A2A35;
}
.plat-icon.youtube { color: #FF0000; }
.plat-icon.netflix { color: #E50914; font-weight: 800; font-family: sans-serif; }
.plat-icon.mp4 { color: var(--accent-color); }

.platform-btn.selecionada .plat-icon { border: 2px solid var(--accent-color); }

#area-link {
    display: flex; flex-direction: column; gap: 15px;
}

#input-link-video {
    width: 100%; padding: 15px; border-radius: 12px;
    background: #2A2A35; border: none; color: white; outline: none; font-size: 14px;
}

.btn-primary {
    background: var(--primary-color); color: white;
    padding: 15px; border: none; border-radius: 12px;
    font-weight: bold; font-size: 16px; cursor: pointer;
}
