:root {
    --bg-gradient: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    --primary: #e60039;
    --primary-hover: #b3002c;
    --text-dark: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.95); 
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

html, body { 
    margin: 0; padding: 0; 
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; 
    background: var(--bg-gradient); 
    background-attachment: fixed;
    color: var(--text-dark); 
    min-height: 100vh; 
    overflow-x: hidden; 
}

*, *::before, *::after { box-sizing: border-box; }

.glass, .glass-card { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.glass-card { border-radius: 16px; padding: 24px; }

/* ======== NAVBAR & NAVIGASI ======== */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; position: sticky; top: 0; z-index: 1000; width: 100%;}
.brand { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); text-decoration: none; }
.brand span { color: var(--primary); }
/* FIX: Gunakan gap untuk jarak otomatis antar menu */
.nav-links { display: flex; align-items: center; z-index: 999; gap: 20px; } 
.nav-links a.nav-item { text-decoration: none; color: var(--text-dark); font-weight: 600; transition: color 0.3s; }
.nav-links a.nav-item:hover { color: var(--primary); }

.hamburger { display: none; flex-direction: column; cursor: pointer; gap: 5px; z-index: 2000; padding: 5px;}
.hamburger span { width: 25px; height: 3px; background: var(--text-dark); transition: all 0.3s ease-in-out; border-radius: 3px; }
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); background: var(--primary); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background: var(--primary); }

/* Buttons & Inputs */
button, .btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #ff4b2b 100%); color: white; padding: 10px 20px; border: none; border-radius: 50px; cursor: pointer; font-weight: 600; font-family: 'Poppins'; transition: transform 0.2s, box-shadow 0.3s; text-decoration: none; display: inline-block; text-align: center;}
button:hover, .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(230, 0, 57, 0.4); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); padding: 8px 20px; border-radius: 50px; font-weight: 600; text-decoration: none; transition: all 0.3s; display: inline-block; text-align: center; }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-large { padding: 15px 30px; font-size: 1.1rem; }
.btn-full { width: 100%; margin-top: 10px; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

.form-control { width: 100%; padding: 12px 20px; border: 1px solid #e2e8f0; border-radius: 50px; background: rgba(255,255,255,0.9); font-family: 'Poppins'; outline: none; transition: 0.3s; margin-bottom: 15px; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230, 0, 57, 0.2); }

/* Auth Forms */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 80px); padding: 20px; }
.auth-card { width: 100%; max-width: 420px; padding: 40px 30px; text-align: center; border-radius: 24px; border: 2px solid rgba(255, 255, 255, 0.8); }
.auth-header { margin-bottom: 25px; }
.auth-icon { font-size: 3rem; margin-bottom: 10px; line-height: 1; }
.auth-header h2 { margin-bottom: 5px; color: var(--text-dark); font-weight: 700; font-size: 1.8rem;}
.auth-header p { font-size: 0.95rem; color: #64748b; margin-top: 0;}
.auth-input { width: 100%; padding: 16px 24px; border: 2px solid #e2e8f0; border-radius: 50px; background: #f8fafc; font-family: 'Poppins', sans-serif; font-size: 1rem; outline: none; transition: all 0.3s ease; margin-bottom: 16px; color: var(--text-dark);}
.auth-input:focus { border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 4px rgba(230, 0, 57, 0.15); transform: translateY(-2px); }
.auth-btn { padding: 16px; font-size: 1.1rem; border-radius: 50px; letter-spacing: 0.5px; margin-top: 10px; box-shadow: 0 8px 20px rgba(230,0,57,0.3); }
.auth-footer { margin-top: 25px; font-size: 0.95rem; color: #64748b; }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 700; transition: 0.3s; }
.auth-footer a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Layouts */
.fade-in { animation: fadeIn 0.8s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard */
.dashboard-wrapper { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.dashboard-header { margin-bottom: 30px; }
.dashboard-header h2 span { color: var(--primary); }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.action-card { display: flex; flex-direction: column; justify-content: space-between; border-top: 4px solid var(--primary); transition: transform 0.3s; }
.action-card:hover { transform: translateY(-5px); }
.card-icon { font-size: 2.5rem; margin-bottom: 10px; }
.history-section { margin-top: 40px; }
.history-section h3 { color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 15px;}
.mini-room-card { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.room-info { margin-bottom: 10px; text-align: center; }
.room-code-badge { background: #f8fafc; padding: 5px 15px; border-radius: 8px; font-weight: 600; font-family: monospace; letter-spacing: 2px; color: var(--primary); border: 1px dashed var(--primary); display: inline-block;}

/* Room / Watch Area */
.room-container { display: flex; gap: 20px; max-width: 1200px; margin: 20px auto; padding: 0 20px; height: calc(100vh - 100px); }
.video-section { flex: 2; display: flex; flex-direction: column; gap: 15px; }
.room-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; padding: 15px 24px; }
.room-title-area { display: flex; flex-direction: column; gap: 8px; }
.code-area { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;}
.badge { background: var(--primary); color: white; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.url-loader { display: flex; gap: 10px; flex: 1; min-width: 250px; justify-content: flex-end;}
.url-loader input { margin-bottom: 0; max-width: 300px;}

.player-wrapper { position: relative; padding-bottom: 56.25%; height: 0; background: #000; overflow: hidden; border-radius: 16px; }
.player-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.status-card { padding: 15px 24px; }
#user-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
#user-list li { background: rgba(230, 0, 57, 0.1); padding: 5px 12px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; color: var(--primary);}

/* Chat Section */
.chat-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.chat-header { padding: 15px; background: rgba(255, 255, 255, 0.9); border-bottom: 1px solid var(--glass-border); font-weight: 600; text-align: center; }
.chat-box { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 15px; border-radius: 18px; max-width: 80%; width: fit-content; font-size: 0.9rem; animation: fadeIn 0.3s ease;}
.msg { background: #f1f5f9; color: #334155; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.self { background: linear-gradient(135deg, var(--primary) 0%, #ff4b2b 100%); color: white; align-self: flex-end; border-bottom-right-radius: 4px; border-bottom-left-radius: 18px;}
.msg-author { font-size: 0.75rem; font-weight: 600; margin-bottom: 3px; opacity: 0.8; }
.chat-input-area { padding: 15px; border-top: 1px solid var(--glass-border); display: flex; gap: 10px; background: rgba(255,255,255,0.7); }
.chat-input-area input { margin-bottom: 0; flex: 1;}

/* ======== MOBILE FIXES (NAVIGASI) ======== */
@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-links { 
        position: fixed; top: 0; right: 0; 
        width: 260px; height: 100vh; 
        background: #ffffff; 
        display: flex; flex-direction: column; 
        padding-top: 80px; gap: 0;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
        box-shadow: -5px 0 25px rgba(0,0,0,0.15); 
    }
    .nav-links.active { transform: translateX(0); }
    
    /* FIX: Navigasi Menu biar ukurannya pas di HP */
    .nav-links a.nav-item { 
        margin: 0; padding: 18px 30px; 
        font-size: 1.1rem; width: 100%; 
        border-bottom: 1px solid #f1f5f9;
    }
    .nav-links .nav-btn { 
        width: calc(100% - 40px) !important; 
        margin: 20px auto !important; 
    }
    
    .room-container { flex-direction: column; height: auto; min-height: 100vh; padding: 15px; margin: 0 auto; gap: 15px; width: 100%; }
    .video-section { width: 100%; }
    .room-header { flex-direction: column; align-items: stretch; padding: 15px; gap: 15px;}
    .url-loader { width: 100%; flex-direction: column; justify-content: stretch; }
    .url-loader input { max-width: 100%; width: 100%; margin-bottom: 0; }
    .chat-section { height: 500px; min-height: 500px; width: 100%; margin-bottom: 30px; border-radius: 16px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-wrapper { padding: 15px; margin-top: 20px; }
}

/* Typing Indicator Style */
.typing-indicator {
    padding: 0 15px 10px;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
    min-height: 25px;
    transition: all 0.3s;
}
