:root {
  --primary: #0095f6;
  --primary-dark: #0081d6;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #dbdbdb;
  --text: #262626;
  --text-secondary: #8e8e8e;
  --danger: #ed4956;
  --success: #00c853;
  --warning: #ffab00;
  --sidebar-bg: #ffffff;
  --sidebar-width: 260px;
  --header-height: 54px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
  --transition: 0.2s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--text); overflow:hidden; }
a { color:inherit; text-decoration:none; }
button { cursor:pointer; border:none; background:none; font-family:inherit; font-size:inherit; }
input, textarea, select { font-family:inherit; font-size:inherit; border:none; outline:none; }
img { max-width:100%; display:block; }
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#ccc; border-radius:3px; }

.screen { display:none; height:100vh; width:100vw; position:absolute; top:0; left:0; }
.screen.active { display:flex; }

/* LOGIN */
#screen-login, #screen-signup {
  background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  align-items:center; justify-content:center;
}
.login-container, .signup-container {
  display:flex; flex-direction:column; align-items:center; width:100%; max-width:380px; padding:20px;
}
.login-logo, .signup-logo { text-align:center; margin-bottom:30px; color:#fff; }
.login-logo i, .signup-logo i { font-size:48px; margin-bottom:10px; display:block; }
.login-logo h1, .signup-logo h1 { font-size:32px; font-weight:700; letter-spacing:-0.5px; }
.login-card, .signup-card {
  background:#fff; border-radius:var(--radius); padding:30px; width:100%;
  box-shadow:var(--shadow-lg); text-align:center;
}
.login-card h2, .signup-card h2 { margin-bottom:20px; font-size:20px; }
.login-avatar {
  width:80px; height:80px; border-radius:50%; margin:0 auto 20px;
  background:var(--border); overflow:hidden; border:2px solid var(--border);
}
.login-avatar img { width:100%; height:100%; object-fit:cover; }
#login-form, #signup-form { display:flex; flex-direction:column; gap:10px; }
#login-form input, #signup-form input {
  padding:10px 14px; border:1px solid var(--border); border-radius:6px;
  background:#fafafa; font-size:14px; transition:border var(--transition);
}
#login-form input:focus, #signup-form input:focus { border-color:var(--primary); background:#fff; }
.form-row { display:flex; gap:10px; }
.form-row input { flex:1; min-width:0; box-sizing:border-box; }
.btn-primary {
  background:var(--primary); color:#fff; padding:10px 16px; border-radius:6px;
  font-weight:600; font-size:14px; margin-top:6px; transition:background var(--transition);
}
.btn-primary:hover { background:var(--primary-dark); }
.btn-primary:disabled { opacity:0.5; cursor:not-allowed; }
.btn-secondary {
  background:transparent; color:var(--primary); padding:8px 16px;
  border:1px solid var(--primary); border-radius:6px; font-weight:600; font-size:14px;
}
.btn-danger { background:var(--danger); color:#fff; padding:8px 16px; border-radius:6px; font-weight:600; font-size:14px; }
.btn-google {
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:#fff; border:1px solid var(--border); padding:10px 16px;
  border-radius:6px; width:100%; font-size:14px; margin-top:4px; transition:background var(--transition);
}
.btn-google:hover { background:#f5f5f5; }
.login-divider { display:flex; align-items:center; margin:16px 0; color:var(--text-secondary); font-size:13px; }
.login-divider::before, .login-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.login-divider span { padding:0 12px; }
.login-signup { margin-top:16px; font-size:14px; color:var(--text-secondary); }
.login-signup a { color:var(--primary); font-weight:600; }

/* MAIN LAYOUT */
.main-layout { display:flex; height:100vh; width:100vw; }
.sidebar {
  width:var(--sidebar-width); background:var(--sidebar-bg); border-right:1px solid var(--border);
  display:flex; flex-direction:column; height:100vh; position:sticky; top:0; flex-shrink:0;
}
.sidebar-header { padding:16px 20px; border-bottom:1px solid var(--border); }
.logo-small { display:flex; align-items:center; gap:8px; font-size:20px; font-weight:700; }
.logo-small i { color:var(--primary); font-size:24px; }
.sidebar-nav { flex:1; padding:8px 0; overflow-y:auto; }
.nav-item {
  display:flex; align-items:center; gap:16px; padding:10px 20px;
  color:var(--text); font-size:15px; font-weight:500; transition:background var(--transition);
  cursor:pointer; border-left:3px solid transparent;
}
.nav-item:hover { background:#fafafa; }
.nav-item.active { border-left-color:var(--primary); color:var(--primary); font-weight:600; }
.nav-item i { width:24px; text-align:center; font-size:18px; }
.nav-item .badge {
  margin-left:auto; background:var(--danger); color:#fff; font-size:11px;
  padding:2px 7px; border-radius:10px; font-weight:600;
}
.sidebar-footer { border-top:1px solid var(--border); padding:4px 0; }
.main-content { flex:1; overflow-y:auto; background:var(--bg); position:relative; }
.panel { display:none; padding:24px; max-width:960px; margin:0 auto; width:100%; }
.panel.active { display:block; }

/* HEADER */
.panel-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 0; margin-bottom:16px; border-bottom:1px solid var(--border);
}
.panel-header h2 { font-size:18px; font-weight:600; }
.search-bar {
  display:flex; align-items:center; background:#fafafa; border:1px solid var(--border);
  border-radius:8px; padding:8px 14px; gap:8px; max-width:360px; width:100%;
}
.search-bar input { flex:1; background:transparent; font-size:14px; }
.search-bar i { color:var(--text-secondary); }

/* FEED */
.feed-create-post {
  background:#fff; border-radius:var(--radius); padding:12px 16px;
  margin-bottom:16px; box-shadow:var(--shadow); display:flex; align-items:center; gap:12px;
}
.feed-create-post .user-avatar-sm {
  width:36px; height:36px; border-radius:50%; background:var(--border); overflow:hidden; flex-shrink:0;
}
.feed-create-post .user-avatar-sm img { width:100%; height:100%; object-fit:cover; }
.feed-create-post input {
  flex:1; padding:10px 14px; background:#fafafa; border-radius:20px; font-size:14px;
}
.feed-create-post .btn-post {
  background:var(--primary); color:#fff; padding:8px 20px; border-radius:20px;
  font-weight:600; font-size:14px; transition:background var(--transition);
}
.feed-create-post .btn-post:hover { background:var(--primary-dark); }

.post-card {
  background:#fff; border-radius:var(--radius); margin-bottom:16px;
  box-shadow:var(--shadow); overflow:hidden;
}
.post-header {
  display:flex; align-items:center; padding:12px 16px; gap:10px;
}
.post-header .user-avatar-sm {
  width:36px; height:36px; border-radius:50%; overflow:hidden; flex-shrink:0;
}
.post-header .user-avatar-sm img { width:100%; height:100%; object-fit:cover; }
.post-header .user-info { flex:1; }
.post-header .user-info .username { font-weight:600; font-size:14px; }
.post-header .user-info .time { font-size:12px; color:var(--text-secondary); }
.post-header .more-btn { font-size:18px; color:var(--text-secondary); padding:4px; }
.post-image { width:100%; max-height:600px; object-fit:cover; background:#000; }
.post-image img { width:100%; max-height:600px; object-fit:contain; }
.post-actions { display:flex; padding:10px 16px; gap:16px; align-items:center; }
.post-actions button { font-size:22px; color:var(--text); transition:transform var(--transition); }
.post-actions button:hover { transform:scale(1.15); }
.post-actions button.liked { color:var(--danger); }
.post-stats { padding:0 16px 8px; font-size:14px; font-weight:600; }
.post-caption { padding:0 16px 12px; font-size:14px; line-height:1.5; }
.post-caption .username { font-weight:600; margin-right:4px; }
.post-comments { padding:0 16px 12px; border-top:1px solid #f0f0f0; }
.post-comment { display:flex; gap:8px; padding:8px 0; font-size:14px; }
.post-comment .comment-avatar { width:28px; height:28px; border-radius:50%; overflow:hidden; flex-shrink:0; }
.post-comment .comment-avatar img { width:100%; height:100%; object-fit:cover; }
.post-comment .comment-body { flex:1; }
.post-comment .comment-body .comment-user { font-weight:600; margin-right:4px; font-size:13px; }
.post-comment-input { display:flex; padding:8px 16px 12px; gap:8px; align-items:center; }
.post-comment-input input {
  flex:1; padding:8px 12px; background:#fafafa; border-radius:20px; font-size:13px;
}
.post-comment-input button { color:var(--primary); font-weight:600; font-size:13px; }
.post-like-input { display:none; position:absolute; bottom:0; left:0; right:0; background:#fff; padding:8px; border-top:1px solid var(--border); }
.post-like-input.active { display:flex; gap:8px; flex-wrap:wrap; }
.post-like-input button {
  padding:4px 10px; border-radius:16px; font-size:12px; background:#f0f0f0; transition:background var(--transition);
}
.post-like-input button.selected { background:var(--primary); color:#fff; }

/* REELS */
.reels-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.reel-card {
  background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
  cursor:pointer; transition:transform var(--transition);
}
.reel-card:hover { transform:translateY(-2px); }
.reel-thumb { position:relative; aspect-ratio:9/16; background:#000; display:flex; align-items:center; justify-content:center; }
.reel-thumb .play-icon { font-size:48px; color:rgba(255,255,255,0.8); }
.reel-thumb .duration { position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,0.7); color:#fff; padding:2px 8px; border-radius:4px; font-size:12px; }
.reel-info { padding:12px 16px; }
.reel-info h3 { font-size:15px; margin-bottom:4px; }
.reel-info p { font-size:13px; color:var(--text-secondary); }

/* CHAT */
.chats-list { display:flex; flex-direction:column; }
.chat-item {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background:#fff; border-radius:var(--radius); margin-bottom:8px;
  box-shadow:var(--shadow); cursor:pointer; transition:background var(--transition);
}
.chat-item:hover { background:#f0f7ff; }
.chat-avatar {
  width:50px; height:50px; border-radius:50%; overflow:hidden; flex-shrink:0; position:relative;
}
.chat-avatar img { width:100%; height:100%; object-fit:cover; }
.chat-avatar .online-dot {
  position:absolute; bottom:2px; right:2px; width:10px; height:10px;
  background:var(--success); border-radius:50%; border:2px solid #fff;
}
.chat-info { flex:1; min-width:0; }
.chat-info .chat-name { font-weight:600; font-size:15px; }
.chat-info .chat-preview { font-size:13px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-meta { text-align:right; flex-shrink:0; }
.chat-meta .chat-time { font-size:12px; color:var(--text-secondary); }
.chat-meta .unread { background:var(--primary); color:#fff; font-size:11px; padding:2px 7px; border-radius:10px; font-weight:600; }

/* CHAT DETAIL */
.chat-detail-header {
  display:flex; align-items:center; padding:12px 16px; background:#fff;
  border-bottom:1px solid var(--border); gap:12px; position:sticky; top:0; z-index:10;
}
.chat-detail-header .chat-avatar-lg {
  width:44px; height:44px; border-radius:50%; overflow:hidden;
}
.chat-detail-header .chat-avatar-lg img { width:100%; height:100%; object-fit:cover; }
.chat-detail-header .chat-name-lg { font-weight:600; font-size:16px; }
.chat-detail-header .chat-status { font-size:13px; color:var(--success); }
.chat-detail-actions { margin-left:auto; display:flex; gap:12px; }
.chat-detail-actions button { font-size:18px; color:var(--text-secondary); padding:6px; }
.chat-messages {
  flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:4px;
  background:#f0f2f5;
}
.message { max-width:70%; padding:8px 12px; border-radius:16px; font-size:14px; line-height:1.5; position:relative; }
.message.sent { align-self:flex-end; background:var(--primary); color:#fff; border-bottom-right-radius:4px; }
.message.received { align-self:flex-start; background:#fff; border-bottom-left-radius:4px; }
.message .msg-time { font-size:11px; opacity:0.7; margin-top:4px; text-align:right; }
.message .msg-status { font-size:11px; margin-left:4px; color:rgba(255,255,255,0.85); }
.message .msg-status.tick-read { color:#a8d8ff; }
.message.received .msg-status { color:#8e8e8e; }
.message-input {
  display:flex; align-items:center; padding:8px 12px; background:#fff;
  border-top:1px solid var(--border); gap:8px;
}
.message-input input { flex:1; padding:10px 16px; background:#f0f2f5; border-radius:24px; font-size:14px; }
.message-input button { font-size:20px; color:var(--primary); padding:4px 8px; }
.message-input .btn-voice { color:var(--danger); font-size:20px; }
.message-input .btn-attach { color:var(--text-secondary); font-size:18px; }
.message-input .btn-voice-record { color:var(--text-secondary); font-size:20px; padding:4px 8px; display:none; }

/* VOICE MESSAGE */
.voice-msg {
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  background:rgba(255,255,255,0.2); border-radius:16px; min-width:120px;
}
.voice-msg .play-btn { width:28px; height:28px; border-radius:50%; background:rgba(255,255,255,0.3); display:flex; align-items:center; justify-content:center; font-size:12px; }
.voice-msg .play-btn.playing { background:rgba(255,255,255,0.6); }
.voice-msg .waveform { flex:1; height:24px; display:flex; align-items:center; gap:2px; }
.voice-msg .waveform span { width:3px; background:rgba(255,255,255,0.6); border-radius:2px; }
.voice-msg .duration { font-size:12px; opacity:0.8; }

.message.received .voice-msg { background:#f0f2f5; color:#262626; }
.message.received .voice-msg .play-btn { background:rgba(0,0,0,0.1); color:#262626; }
.message.received .voice-msg .waveform span { background:rgba(0,0,0,0.3); }

/* FILE MESSAGE */
.file-msg {
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  background:rgba(255,255,255,0.2); border-radius:12px; min-width:210px; max-width:240px;
}
.file-msg .file-icon {
  width:40px; height:40px; border-radius:8px; background:rgba(0,0,0,0.25);
  display:flex; align-items:center; justify-content:center; font-size:18px; color:#fff; flex-shrink:0;
}
.file-msg .file-info { flex:1; min-width:0; }
.file-msg .file-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-msg .file-size { font-size:11px; opacity:0.8; }
.file-msg .file-download { color:#fff; padding:6px; border-radius:50%; background:rgba(0,0,0,0.25); flex-shrink:0; display:flex; }
.message.received .file-msg { background:#f0f2f5; color:#262626; }
.message.received .file-msg .file-icon { background:#e0e0e0; color:#666; }
.message.received .file-msg .file-download { background:#e0e0e0; color:#666; }

.message .file-name { font-size:12px; opacity:0.8; margin-top:2px; max-width:220px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ATTACH MENU */
.attach-menu { display:flex; flex-direction:column; gap:8px; padding:8px 0; }
.attach-menu h3 { font-size:16px; }
.attach-option {
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:var(--bg); border-radius:8px; font-size:14px; width:100%;
  border:1px solid var(--border); color:var(--text); transition:background 0.2s;
}
.attach-option i { font-size:18px; color:var(--primary); width:24px; text-align:center; }
.attach-option:hover { background:#eef3f8; }

/* Recording Bar */
.rec-dot { width:12px; height:12px; border-radius:50%; background:var(--danger); animation:blink 1s infinite; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

/* Recording */
.btn-voice-record.recording { color:var(--danger); animation:pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

/* Voice Record Timer */
.voice-recording-bar { position:fixed; bottom:70px; left:50%; transform:translateX(-50%); background:rgba(255,255,255,0.95); border-radius:12px; padding:8px 16px; display:flex; align-items:center; gap:8px; box-shadow:var(--shadow-lg); z-index:100; }
.voice-recording-bar .timer { font-size:16px; font-weight:600; font-variant-numeric:tabular-nums; }

/* Video Call */
.video-call-container { position:relative; width:100%; height:100%; max-height:60vh; background:#1a1a2e; border-radius:12px; overflow:hidden; }
.video-call-container video { width:100%; height:100%; object-fit:cover; }
.video-call-container #remote-placeholder { position:absolute; top:0; left:0; width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; color:rgba(255,255,255,0.5); z-index:2; }


/* STORIES */
.stories-bar {
  display:flex; gap:12px; padding:12px 0; overflow-x:auto; background:#fff;
  border-radius:var(--radius); margin-bottom:16px; box-shadow:var(--shadow);
}
.story-item {
  display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer;
  min-width:68px; flex-shrink:0;
}
.story-ring {
  width:60px; height:60px; border-radius:50%; padding:3px;
  background:linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.story-ring img { width:100%; height:100%; border-radius:50%; object-fit:cover; border:2px solid #fff; }
.story-ring .story-add { display:flex; align-items:center; justify-content:center; width:100%; height:100%; border-radius:50%; background:rgba(0,0,0,0.3); color:#fff; font-size:20px; }
.story-item span { font-size:12px; max-width:60px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }

/* STORY VIEWER */
.story-viewer {
  position:fixed; top:0; left:0; width:100%; height:100%; background:#000; z-index:1000;
  display:flex; align-items:center; justify-content:center;
}
.story-viewer-content { position:relative; width:100%; height:100%; max-width:480px; margin:auto; }
.story-viewer-image { width:100%; height:100%; object-fit:contain; }
.story-viewer-header {
  position:absolute; top:0; left:0; right:0; padding:12px 16px;
  display:flex; align-items:center; gap:10px; color:#fff; z-index:10;
}
.story-viewer-header .story-user-avatar { width:32px; height:32px; border-radius:50%; overflow:hidden; border:2px solid #fff; }
.story-viewer-header .story-user-avatar img { width:100%; height:100%; object-fit:cover; }
.story-time-ago { font-size:12px; color:rgba(255,255,255,0.7); margin-left:8px; }
.story-close-btn { margin-left:auto; color:#fff; font-size:20px; background:none; cursor:pointer; }
.story-text-overlay { position:absolute; bottom:80px; left:0; right:0; text-align:center; color:#fff; padding:0 20px; }
.story-text-overlay:empty { display:none; }
.story-text-overlay { background:rgba(0,0,0,0.4); padding:8px 16px; border-radius:8px; display:inline-block; margin:0 auto; }
.story-progress { position:absolute; top:50px; left:0; right:0; display:flex; gap:3px; padding:0 8px; z-index:10; }
.story-progress-seg { flex:1; height:2px; background:rgba(255,255,255,0.3); border-radius:2px; overflow:hidden; }
.story-progress-bar { height:100%; background:#fff; width:0%; transition:width 0.1s linear; }
.story-viewer-footer { position:absolute; bottom:0; left:0; right:0; padding:12px 16px; background:linear-gradient(transparent,rgba(0,0,0,0.6)); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.story-footer-btn { background:rgba(255,255,255,0.15); color:#fff; padding:6px 12px; border-radius:20px; font-size:13px; display:flex; align-items:center; gap:6px; cursor:pointer; }
.story-footer-btn:hover { background:rgba(255,255,255,0.25); }
.story-reactions-bar { display:flex; gap:4px; flex:1; }
.story-emoji-btn { width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,0.15); font-size:18px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:transform 0.15s; }
.story-emoji-btn:hover { transform:scale(1.2); background:rgba(255,255,255,0.25); }
.story-reply-row { display:flex; gap:8px; flex:1; }
.story-reply-input { flex:1; padding:8px 14px; border-radius:20px; border:1px solid rgba(255,255,255,0.3); background:rgba(255,255,255,0.1); color:#fff; font-size:14px; }
.story-reply-input::placeholder { color:rgba(255,255,255,0.5); }
.story-reply-send { width:36px; height:36px; border-radius:50%; background:var(--primary); color:#fff; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
@media (max-width:768px) {
  .story-viewer-footer { padding:8px 10px; }
  .story-reactions-bar { overflow-x:auto; }
  .story-emoji-btn { width:32px; height:32px; font-size:16px; }
}
.story-progress { position:absolute; top:0; left:0; right:0; height:3px; background:rgba(255,255,255,0.3); z-index:10; }
.story-progress-bar { height:100%; background:#fff; transition:width 0.1s linear; }
.story-nav { position:absolute; top:0; bottom:0; width:20%; z-index:10; cursor:pointer; }
.story-nav.prev { left:0; }
.story-nav.next { right:0; }

/* LIVE */
.live-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; }
.live-card {
  background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
  cursor:pointer; transition:transform var(--transition);
}
.live-card:hover { transform:translateY(-2px); }
.live-thumb { position:relative; aspect-ratio:16/9; background:#1a1a2e; display:flex; align-items:center; justify-content:center; }
.live-badge { position:absolute; top:10px; left:10px; background:var(--danger); color:#fff; padding:3px 10px; border-radius:4px; font-size:12px; font-weight:700; display:flex; align-items:center; gap:4px; }
.live-badge .dot { width:8px; height:8px; background:#fff; border-radius:50%; animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(110%) translateY(8px)} to{opacity:1;transform:translateY(110%)} }
.live-viewers { position:absolute; bottom:10px; left:10px; background:rgba(0,0,0,0.7); color:#fff; padding:3px 8px; border-radius:4px; font-size:12px; display:flex; align-items:center; gap:4px; }
.live-info { padding:12px 16px; }
.live-info h3 { font-size:15px; margin-bottom:4px; }
.live-info p { font-size:13px; color:var(--text-secondary); }
.live-creator { display:flex; align-items:center; gap:8px; padding:8px 16px; border-top:1px solid #f0f0f0; }
.live-creator .avatar { width:28px; height:28px; border-radius:50%; overflow:hidden; }
.live-creator .avatar img { width:100%; height:100%; object-fit:cover; }
.live-creator span { font-size:13px; font-weight:600; }

/* LIVE VIEWER */
.live-viewer {
  position:fixed; top:0; left:0; width:100%; height:100%; background:#000; z-index:1000;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.live-viewer-video { position:relative; width:100%; max-width:640px; aspect-ratio:9/16; background:#1a1a2e; display:flex; align-items:center; justify-content:center; border-radius:8px; overflow:hidden; }
.live-viewer-video .live-placeholder { color:#fff; font-size:18px; text-align:center; }
.live-viewer-video .live-placeholder i { font-size:48px; display:block; margin-bottom:12px; }
.live-viewer-controls { display:flex; gap:16px; margin-top:16px; }
.live-viewer-controls button {
  width:48px; height:48px; border-radius:50%; background:rgba(255,255,255,0.2); color:#fff;
  font-size:20px; display:flex; align-items:center; justify-content:center; transition:background var(--transition);
}
.live-viewer-controls button:hover { background:rgba(255,255,255,0.4); }
.live-viewer-controls button.end-live { background:var(--danger); }
.live-audio-meter-wrap { flex:1; max-width:120px; min-width:60px; height:8px; background:rgba(255,255,255,0.15); border-radius:4px; overflow:hidden; margin:auto 10px; align-self:center; }
.live-audio-meter-wrap #live-audio-meter { display:block; height:100%; width:0%; background:#31c6ff; border-radius:4px; transition:width 100ms linear; }
.live-audio-meter-wrap #live-audio-meter.on { background:#2ecc71; }
.live-viewer-header { position:absolute; top:0; left:0; right:0; padding:12px 16px; display:flex; align-items:center; gap:10px; color:#fff; z-index:10; background:linear-gradient(rgba(0,0,0,0.5),transparent); }
.live-viewer-header span { font-weight:600; }
.live-viewer-viewers { position:absolute; top:50px; right:16px; background:rgba(0,0,0,0.7); color:#fff; padding:4px 10px; border-radius:4px; font-size:13px; display:flex; align-items:center; gap:4px; }

/* PROFILE */
.profile-header {
  background:#fff; border-radius:var(--radius); padding:24px; margin-bottom:16px;
  box-shadow:var(--shadow); text-align:center;
}
.profile-avatar-lg { width:100px; height:100px; border-radius:50%; overflow:hidden; margin:0 auto 12px; border:2px solid var(--border); }
.profile-avatar-lg img { width:100%; height:100%; object-fit:cover; }
.profile-name { font-size:20px; font-weight:700; margin-bottom:4px; }
.profile-bio { font-size:14px; color:var(--text-secondary); margin-bottom:12px; }
.profile-stats { display:flex; justify-content:center; gap:32px; margin-bottom:12px; }
.profile-stat { text-align:center; }
.profile-stat .stat-num { font-size:18px; font-weight:700; }
.profile-stat .stat-label { font-size:12px; color:var(--text-secondary); }
.profile-actions { display:flex; gap:8px; justify-content:center; }
.profile-posts-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; }
.profile-post-grid-item { aspect-ratio:1; background:#f0f0f0; display:flex; align-items:center; justify-content:center; font-size:24px; color:#ccc; }
.profile-post-grid-item img { width:100%; height:100%; object-fit:cover; }

/* PROFILE AVATAR + BUTTON */
.profile-avatar-wrap { position:relative; width:100px; height:100px; margin:0 auto 12px; }
.profile-avatar-wrap .profile-avatar-lg { width:100px; height:100px; border-radius:50%; overflow:hidden; margin:0; border:2px solid var(--border); }
.profile-avatar-wrap .profile-avatar-lg img { width:100%; height:100%; object-fit:cover; }
.profile-avatar-ring { position:relative; width:100px; height:100px; border-radius:50%; padding:3px; background:linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.profile-avatar-ring.no-stories { background:var(--border); }
.profile-avatar-ring .profile-avatar-lg { width:94px; height:94px; border-radius:50%; overflow:hidden; margin:0; border:2px solid #fff; }
.profile-avatar-add { position:absolute; bottom:0; right:0; width:32px; height:32px; border-radius:50%; background:var(--primary); color:#fff; border:2px solid #fff; font-size:14px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:transform 0.2s; z-index:5; }
.profile-avatar-add:hover { transform:scale(1.1); }
.profile-avatar-add:active { transform:scale(0.95); }

/* ADD MENU POPUP */
.profile-add-menu { position:absolute; bottom:0; right:0; z-index:100; transform:translateY(110%); min-width:220px; background:#fff; border-radius:12px; box-shadow:0 4px 20px rgba(0,0,0,0.15); overflow:hidden; animation:fadeInUp 0.2s ease; }
.profile-add-menu-overlay { position:fixed; top:0; left:0; right:0; bottom:0; z-index:99; }
.profile-add-menu-item { display:flex; align-items:center; gap:12px; padding:12px 16px; width:100%; text-align:left; font-size:14px; color:var(--text); background:none; cursor:pointer; transition:background 0.15s; }
.profile-add-menu-item:hover { background:#f5f5f5; }
.profile-add-menu-item i { width:22px; text-align:center; font-size:16px; }
.profile-add-menu-item .fa-circle-plus { color:#e1306c; }
.profile-add-menu-item .fa-clapperboard { color:#833ab4; }
.profile-add-menu-item .fa-square-plus { color:#405de6; }
.profile-add-menu-item .fa-camera { color:#5851db; }

/* CONTENT CREATION MODAL */
.create-content-modal { max-width:500px; }
.create-content-tabs { display:flex; border-bottom:1px solid var(--border); margin-bottom:16px; }
.create-content-tab { flex:1; padding:12px; text-align:center; font-size:14px; font-weight:600; color:var(--text-secondary); cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.create-content-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.create-content-preview { width:100%; aspect-ratio:9/16; background:#f0f0f0; border-radius:8px; display:flex; align-items:center; justify-content:center; overflow:hidden; margin-bottom:12px; cursor:pointer; position:relative; }
.create-content-preview img, .create-content-preview video { width:100%; height:100%; object-fit:contain; }
.create-content-preview .upload-placeholder { text-align:center; color:var(--text-secondary); }
.create-content-preview .upload-placeholder i { font-size:48px; margin-bottom:8px; display:block; }
.create-content-text { width:100%; min-height:80px; padding:10px; border:1px solid var(--border); border-radius:6px; resize:vertical; font-size:14px; margin-bottom:12px; }
.create-overlay-text { position:absolute; top:0; left:0; right:0; bottom:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.4); color:#fff; font-size:18px; font-weight:600; text-align:center; padding:16px; pointer-events:none; }

/* STORY RING ON PROFILE */
@keyframes storyRingSpin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
.profile-avatar-ring.has-stories { background:conic-gradient(from 0deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888,#f09433); cursor:pointer; }
.profile-avatar-ring.no-stories { cursor:pointer; }
.profile-avatar-ring:hover { opacity:0.85; }

/* CONTENT FEED ITEMS */
.content-card { background:#fff; border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:16px; overflow:hidden; }
.content-card-header { display:flex; align-items:center; gap:10px; padding:12px 16px; }
.content-card-header .avatar { width:36px; height:36px; border-radius:50%; overflow:hidden; }
.content-card-header .avatar img { width:100%; height:100%; object-fit:cover; }
.content-card-header .username { font-weight:600; font-size:14px; }
.content-card-header .time { margin-left:auto; font-size:12px; color:var(--text-secondary); }
.content-card-media { width:100%; max-height:500px; background:#000; display:flex; align-items:center; justify-content:center; }
.content-card-media img, .content-card-media video { width:100%; max-height:500px; object-fit:contain; }
.content-card-actions { display:flex; gap:16px; padding:10px 16px; }
.content-card-actions button { font-size:22px; color:var(--text); background:none; cursor:pointer; }
.content-card-actions button.liked { color:var(--danger); }
.content-card-caption { padding:0 16px 12px; font-size:14px; }

/* REELS GRID */
.reel-card { background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); cursor:pointer; transition:transform 0.2s; }
.reel-card:hover { transform:translateY(-2px); }
.reel-thumb { position:relative; aspect-ratio:9/16; background:#1a1a2e; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.reel-thumb img, .reel-thumb video { width:100%; height:100%; object-fit:cover; }
.reel-thumb .play-icon { position:absolute; font-size:48px; color:rgba(255,255,255,0.8); }
.reel-thumb .reel-views { position:absolute; bottom:8px; left:8px; background:rgba(0,0,0,0.6); color:#fff; padding:3px 8px; border-radius:4px; font-size:11px; display:flex; align-items:center; gap:4px; }
.reel-thumb .duration { position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,0.6); color:#fff; padding:2px 6px; border-radius:3px; font-size:11px; }
.reel-info { display:flex; align-items:center; gap:8px; padding:8px 12px; }
.reel-info .reel-avatar { width:24px; height:24px; border-radius:50%; overflow:hidden; }
.reel-info .reel-avatar img { width:100%; height:100%; object-fit:cover; }
.reel-info p { font-size:13px; font-weight:600; }

/* REELS VIEWER */
.reels-viewer { position:fixed; top:0; left:0; right:0; bottom:0; background:#000; z-index:1000; display:flex; align-items:center; justify-content:center; }
.reels-viewer-content { position:relative; width:100%; max-width:400px; height:100%; }
.reels-viewer-media { width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.reels-viewer-media video { width:100%; height:100%; object-fit:contain; }
.reels-viewer-overlay { position:absolute; bottom:0; left:0; right:0; padding:16px; background:linear-gradient(transparent,rgba(0,0,0,0.7)); color:#fff; }
.reels-viewer-sidebar { position:absolute; right:10px; bottom:80px; display:flex; flex-direction:column; gap:20px; }
.reels-viewer-sidebar button { font-size:26px; color:#fff; background:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:4px; }
.reels-viewer-sidebar button span { font-size:11px; }
.reels-viewer-sidebar button.liked { color:var(--danger); }
.reels-viewer-close { position:absolute; top:16px; right:16px; font-size:24px; color:#fff; background:none; cursor:pointer; }

/* SEARCH */
.search-results { display:flex; flex-direction:column; gap:8px; }
.search-result-item {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background:#fff; border-radius:var(--radius); box-shadow:var(--shadow); cursor:pointer;
  transition:background var(--transition);
}
.search-result-item:hover { background:#f5f5f5; }
.search-result-item .avatar { width:44px; height:44px; border-radius:50%; overflow:hidden; }
.search-result-item .avatar img { width:100%; height:100%; object-fit:cover; }
.search-result-item .result-info { flex:1; }
.search-result-item .result-info .name { font-weight:600; font-size:14px; }
.search-result-item .result-info .handle { font-size:13px; color:var(--text-secondary); }

/* NOTIFICATIONS */
.notif-item {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background:#fff; border-radius:var(--radius); margin-bottom:8px;
  box-shadow:var(--shadow); cursor:pointer; transition:background var(--transition);
}
.notif-item:hover { background:#f5f5f5; }
.notif-item.unread { border-left:3px solid var(--primary); }
.notif-icon {
  width:40px; height:40px; border-radius:50%; background:#f0f0f0;
  display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0;
}
.notif-content { flex:1; font-size:14px; line-height:1.4; }
.notif-content strong { font-weight:600; }
.notif-time { font-size:12px; color:var(--text-secondary); margin-top:2px; }

/* MODAL */
.modal-overlay {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(0,0,0,0.5); z-index:999; display:flex; align-items:center; justify-content:center;
  padding:20px;
}
.modal-overlay.hidden { display:none; }
.modal {
  background:#fff; border-radius:var(--radius); padding:24px; max-width:500px; width:100%;
  max-height:80vh; overflow-y:auto; box-shadow:var(--shadow-lg); position:relative;
}
.modal h3 { margin-bottom:16px; font-size:18px; }
.modal-close { position:absolute; top:12px; right:16px; font-size:20px; color:var(--text-secondary); cursor:pointer; }

/* TOAST */
.toast-container { position:fixed; top:20px; right:20px; z-index:2000; display:flex; flex-direction:column; gap:8px; }
.toast {
  background:#333; color:#fff; padding:12px 20px; border-radius:8px; font-size:14px;
  box-shadow:var(--shadow-lg); animation:slideIn 0.3s ease; max-width:360px;
  display:flex; align-items:center; gap:8px;
}
.toast.success { border-left:4px solid var(--success); }
.toast.error { border-left:4px solid var(--danger); }
.toast.info { border-left:4px solid var(--primary); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ENCRYPTION BADGE */
.encrypt-badge {
  display:inline-flex; align-items:center; gap:4px; font-size:11px; color:var(--success);
  background:#e8f5e9; padding:2px 8px; border-radius:10px; font-weight:500;
}
.encrypt-badge i { font-size:10px; }

/* CALL BAR */
.call-bar {
  position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,0.9); color:#fff; padding:12px 24px;
  border-radius:16px 16px 0 0; display:flex; align-items:center; gap:16px;
  z-index:500; min-width:320px;
}
.call-bar .call-avatar { width:40px; height:40px; border-radius:50%; overflow:hidden; }
.call-bar .call-avatar img { width:100%; height:100%; object-fit:cover; }
.call-bar .call-info { flex:1; }
.call-bar .call-info .name { font-weight:600; font-size:14px; }
.call-bar .call-info .duration { font-size:12px; color:#aaa; }
.call-bar .call-btn {
  width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:18px; color:#fff; transition:background var(--transition);
}
.call-bar .call-btn.end { background:var(--danger); }
.call-bar .call-btn.mute { background:rgba(255,255,255,0.2); }

/* REACTION PICKER */
.reaction-picker {
  display:flex; gap:4px; padding:8px; background:#fff; border-radius:24px;
  box-shadow:var(--shadow-lg); position:absolute; bottom:60px; left:50%; transform:translateX(-50%);
  z-index:100;
}
.reaction-picker button {
  font-size:28px; padding:4px 8px; border-radius:50%; transition:transform var(--transition);
}
.reaction-picker button:hover { transform:scale(1.3); }

/* CREATE POST MODAL */
.create-post-modal .post-form { display:flex; flex-direction:column; gap:12px; }
.create-post-modal textarea {
  width:100%; min-height:100px; padding:12px; border:1px solid var(--border);
  border-radius:8px; resize:vertical; font-size:14px;
}
.create-post-modal .media-preview {
  width:100%; max-height:300px; object-fit:contain; border-radius:8px; background:#000;
}
.create-post-modal .upload-area {
  border:2px dashed var(--border); border-radius:8px; padding:24px;
  text-align:center; color:var(--text-secondary); cursor:pointer; transition:border var(--transition);
}
.create-post-modal .upload-area:hover { border-color:var(--primary); }

/* SETTINGS */
.settings-section { background:#fff; border-radius:var(--radius); margin-bottom:16px; box-shadow:var(--shadow); overflow:hidden; }
.settings-section h3 { padding:12px 16px; font-size:14px; color:var(--text-secondary); border-bottom:1px solid #f0f0f0; }
.settings-item {
  display:flex; align-items:center; padding:12px 16px; gap:12px; cursor:pointer;
  transition:background var(--transition);
}
.settings-item:hover { background:#fafafa; }
.settings-item i { width:24px; text-align:center; color:var(--text-secondary); }
.settings-item span { flex:1; font-size:14px; }
.settings-item .arrow { color:#ccc; }

/* RESPONSIVE */
@media (max-width:768px) {
  .main-layout { flex-direction:column; }

  /* ALT NAVİGASYON ÇUBUĞU */
  .sidebar {
    position:fixed; top:auto; bottom:0; left:0; right:0;
    width:100%; height:64px; flex-direction:row;
    border-right:none; border-top:1px solid var(--border); z-index:1000;
  }
  .sidebar-header { display:none; }
  .sidebar-nav { flex:1; display:flex; flex-direction:row; padding:0; }
  .sidebar-footer { flex:0 0 auto; display:flex; flex-direction:row; padding:0; border-top:none; }
  .sidebar-nav .nav-item, .sidebar-footer .nav-item {
    flex:1; min-width:0; flex-direction:column; justify-content:center; align-items:center;
    gap:2px; padding:6px 2px; border-left:none; border-top:2px solid transparent; position:relative;
  }
  .sidebar-nav .nav-item.active, .sidebar-footer .nav-item.active {
    border-top-color:var(--primary); border-left-color:transparent;
  }
  .sidebar-nav .nav-item i, .sidebar-footer .nav-item i { width:auto; font-size:19px; }
  .sidebar-nav .nav-item span, .sidebar-footer .nav-item span { display:block; font-size:9px; line-height:1.1; text-align:center; white-space:nowrap; }
  .sidebar-nav .nav-item .badge { position:absolute; top:5px; right:calc(50% - 20px); margin:0; padding:1px 5px; font-size:9px; }

  .main-content { padding-bottom:70px; }
  .panel { padding:12px; padding-bottom:72px; }

  /* Chat tam ekran */
  #panel-chat-detail.active {
    position:fixed; top:0; left:0; right:0; bottom:0; z-index:1001;
    max-width:none; margin:0; padding:0; display:flex; flex-direction:column;
  }
  body:has(#panel-chat-detail.active) .sidebar { display:none; }
  .main-content { padding-bottom:0; }
  #panel-chat-detail.active .chat-detail-header { position:static; }
  #panel-chat-detail.active .chat-messages { flex:1; height:auto; }
  #panel-chat-detail.active .message-input { position:static; }

  .reels-grid { grid-template-columns:1fr; }
  .live-grid { grid-template-columns:1fr; }
  .chat-detail-header { padding:8px 8px 8px 40px; }
  .chat-messages { padding:12px 8px; }
  .message-input { padding:8px; gap:4px; }
  .message-input input { padding:8px 12px; font-size:14px; }
  .message-input button { font-size:18px; padding:2px 6px; }
  .chat-list { padding:8px; }
  .chat-item { padding:10px 8px; gap:10px; }
  .chat-avatar { width:40px; height:40px; }
  .chat-info { flex:1; }
  .chat-name { font-size:14px; }
  .chat-preview { font-size:13px; }
  .chat-meta { text-align:right; }
  .chat-name-lg { font-size:16px; }
  .message { max-width:80%; }
  .message .msg-time { font-size:10px; }
  .voice-msg { padding:6px 10px; }
  .voice-msg .play-btn { width:24px; height:24px; font-size:10px; }
  .voice-msg .duration { font-size:11px; }
  .post { margin-bottom:12px; }
  .post-header { padding:8px 12px; gap:8px; }
  .post-content { padding:0 12px 8px; }
  .post-actions { padding:8px 12px; gap:12px; }
  .stories-bar { padding:8px 0; gap:8px; }
  .story-item { min-width:60px; }
  .story-ring { width:50px; height:50px; }
  .feed-container { padding:8px; }
  .feed-container > * { margin-bottom:12px; }
  .nav-bar { height:46px; }
  .nav-bar .nav-item { font-size:10px; padding:6px 2px; }
  .chat-detail-actions button { width:32px; height:32px; font-size:14px; }
  .panel-header h2 { font-size:18px; }
  .profile-avatar-wrap { width:80px; height:80px; }
  .profile-avatar-wrap .profile-avatar-ring { width:80px; height:80px; }
  .profile-avatar-wrap .profile-avatar-ring .profile-avatar-lg { width:74px; height:74px; }
  .profile-avatar-add { width:26px; height:26px; font-size:12px; }
  .profile-add-menu { position:fixed !important; left:50% !important; top:50% !important; transform:translate(-50%,-50%) !important; width:85%; max-width:320px; }
  .create-content-modal { max-width:100%; margin:0; border-radius:16px 16px 0 0; position:fixed; bottom:0; left:0; right:0; max-height:90vh; overflow-y:auto; }
  .reels-viewer-content { max-width:100%; }
  .reels-viewer-sidebar { right:8px; bottom:60px; gap:16px; }
  .reels-viewer-sidebar button { font-size:22px; }
  .story-ring { width:50px; height:50px; padding:2px; }
  .voice-preview-bar { padding:8px 10px; margin:4px; }
  .voice-preview-play { width:32px; height:32px; font-size:12px; }
  .voice-preview-cancel, .voice-preview-send { width:28px; height:28px; font-size:12px; }
  .btn-chat-menu { font-size:18px; color:var(--text-secondary); padding:4px 8px; background:none; cursor:pointer; }
  .chat-detail-actions { display:flex; align-items:center; gap:4px; }
}

.btn-chat-menu { font-size:18px; color:var(--text-secondary); padding:4px 8px; background:none; cursor:pointer; border-radius:50%; transition:background 0.2s; }
.btn-chat-menu:hover { background:rgba(0,0,0,0.05); color:var(--text); }
.chat-detail-actions { display:flex; align-items:center; gap:4px; }

/* VOICE PREVIEW BAR (WhatsApp-style) */
.voice-preview-bar { display:flex; align-items:center; gap:10px; padding:10px 14px; background:#f0f2f5; border-radius:24px; margin:4px 8px; animation:fadeInUp 0.2s ease; }
.voice-preview-play { width:36px; height:36px; border-radius:50%; background:var(--primary); color:#fff; font-size:14px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all 0.2s; flex-shrink:0; }
.voice-preview-play.playing { background:var(--success); }
.voice-preview-wave { display:flex; align-items:center; gap:2px; flex:1; height:24px; }
.voice-preview-wave span { width:3px; background:var(--primary); border-radius:2px; display:inline-block; height:8px; transition:height 0.1s; }
.voice-preview-wave.playing span { animation:voiceWave 0.6s ease-in-out infinite alternate; }
.voice-preview-wave.playing span:nth-child(1) { animation-delay:0s; }
.voice-preview-wave.playing span:nth-child(2) { animation-delay:0.1s; }
.voice-preview-wave.playing span:nth-child(3) { animation-delay:0.2s; }
.voice-preview-wave.playing span:nth-child(4) { animation-delay:0.05s; }
.voice-preview-wave.playing span:nth-child(5) { animation-delay:0.15s; }
.voice-preview-wave.playing span:nth-child(6) { animation-delay:0.25s; }
.voice-preview-wave.playing span:nth-child(7) { animation-delay:0.08s; }
.voice-preview-wave.playing span:nth-child(8) { animation-delay:0.18s; }
@keyframes voiceWave { from{height:6px} to{height:22px} }
.voice-preview-duration { font-size:13px; color:var(--text-secondary); flex-shrink:0; min-width:36px; text-align:center; }
.voice-preview-cancel { width:32px; height:32px; border-radius:50%; background:var(--danger); color:#fff; font-size:14px; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.voice-preview-send { width:32px; height:32px; border-radius:50%; background:var(--primary); color:#fff; font-size:14px; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
@media (max-width:768px) {
  .voice-preview-bar { padding:8px 10px; margin:4px; }
  .voice-preview-play { width:32px; height:32px; font-size:12px; }
  .voice-preview-cancel, .voice-preview-send { width:28px; height:28px; font-size:12px; }
}

/* CALL CONTROLS BAR */
.call-controls-bar { position:absolute; bottom:0; left:0; right:0; display:flex; justify-content:center; padding:16px; background:linear-gradient(transparent,rgba(0,0,0,0.6)); z-index:10; }
.call-end-btn { width:56px; height:56px; border-radius:50%; background:#f44336; color:#fff; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:transform 0.2s; }
.call-end-btn:hover { transform:scale(1.1); }

/* INCOMING CALL POPUP */
.incoming-call-popup { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:9999; background:#1a1a2e; border-radius:24px; padding:32px 40px; text-align:center; color:#fff; box-shadow:0 20px 60px rgba(0,0,0,0.5); animation:incomingCallPulse 1s ease-in-out infinite; min-width:280px; }
@keyframes incomingCallPulse { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) scale(1.03)} }
.incoming-call-ring { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:140px; height:140px; border-radius:50%; border:3px solid rgba(76,175,80,0.5); animation:ringPulse 1.5s ease-out infinite; }
@keyframes ringPulse { 0%{transform:translate(-50%,-50%) scale(0.8);opacity:1} 100%{transform:translate(-50%,-50%) scale(1.6);opacity:0} }
.incoming-call-avatar { width:80px; height:80px; border-radius:50%; overflow:hidden; margin:0 auto 12px; border:3px solid #fff; position:relative; z-index:2; }
.incoming-call-avatar img { width:100%; height:100%; object-fit:cover; }
.incoming-call-name { font-size:20px; font-weight:700; margin-bottom:4px; position:relative; z-index:2; }
.incoming-call-type { font-size:14px; color:rgba(255,255,255,0.7); margin-bottom:24px; position:relative; z-index:2; }
.incoming-call-actions { display:flex; gap:24px; justify-content:center; position:relative; z-index:2; }
.incoming-call-decline { width:56px; height:56px; border-radius:50%; background:#f44336; color:#fff; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:transform 0.2s; }
.incoming-call-accept { width:56px; height:56px; border-radius:50%; background:#4caf50; color:#fff; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:transform 0.2s; }
.incoming-call-decline:hover, .incoming-call-accept:hover { transform:scale(1.1); }
@media (max-width:768px) {
  .incoming-call-popup { width:90%; padding:24px; }
}

/* CALL OVERLAY (tam ekran görüntülü/sesli arama) */
.call-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0;
  z-index: 100000; background:#000; overflow:hidden;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.call-overlay .call-video-remote {
  position:absolute; top:0; left:0; width:100%; height:100%;
  object-fit:cover; background:#000;
}
.call-overlay .call-video-local {
  position:absolute; top:18px; right:18px; width:96px; height:128px;
  border-radius:10px; overflow:hidden; border:2px solid rgba(255,255,255,0.4);
  object-fit:cover; background:#222; z-index:10;
}
.call-overlay.swapped .call-video-remote {
  position:absolute; top:18px; right:18px; width:96px; height:128px;
  border-radius:10px; overflow:hidden; border:2px solid rgba(255,255,255,0.4);
  object-fit:cover; background:#222; z-index:10;
}
.call-overlay.swapped .call-video-local {
  position:absolute; top:0; left:0; width:100%; height:100%;
  border-radius:0; border:none; object-fit:cover; background:#000; z-index:5;
}
.call-overlay .call-avatar {
  position:relative; z-index:5; width:96px; height:96px; border-radius:50%;
  overflow:hidden; border:3px solid rgba(255,255,255,0.5); display:none;
  background:#222;
}
.call-overlay .call-avatar img { width:100%; height:100%; object-fit:cover; }
.call-overlay .call-info {
  position:relative; z-index:5; text-align:center; color:#fff;
  padding:0 16px; margin-top:16px; max-width:90%;
}
.call-overlay .call-name { font-size:20px; font-weight:700; margin-bottom:6px; word-break:break-word; }
.call-overlay .call-status { font-size:14px; opacity:0.75; }
.call-overlay .call-controls {
  position:absolute; bottom:28px; left:0; right:0; z-index:20;
  display:flex; justify-content:center; gap:18px; padding:12px;
}
.call-overlay .call-btn {
  width:60px; height:60px; border-radius:50%; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:22px;
  color:#fff; transition:transform 0.15s;
}
.call-overlay .call-btn:hover { transform:scale(1.08); }
.call-overlay .call-btn-end { background:#f44336; }
.call-overlay .call-btn.muted { background:rgba(255,255,255,0.25); color:#f44336; }
.call-overlay.voice .call-avatar { display:block; }
.call-overlay.voice .call-video-local { display:none; }
@media (max-width:768px) {
  .call-overlay .call-video-local { width:80px; height:106px; top:14px; right:14px; }
  .call-overlay.swapped .call-video-local { width:100%; height:100%; top:0; right:0; }
  .call-overlay .call-btn { width:56px; height:56px; }
}

/* TOGGLE SWITCH */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.3s;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.switch input:checked + .slider {
  background-color: var(--primary);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-item .switch {
  margin-left: auto;
}

/* Follow Request Items */
.notif-item .btn-approve,
.notif-item .btn-reject {
  font-size: 11px;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.notif-item .btn-approve:hover { opacity: 0.8; }
.notif-item .btn-reject:hover { opacity: 0.8; }

/* Call Controls */
.call-control {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  transition: background 0.2s;
}
.call-control:hover { background: rgba(255,255,255,0.4); }
.call-control.muted { background: var(--danger); }

/* Call History */
.call-history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 16px 8px;
}
.call-history-list { border-bottom: 1px solid #eee; margin-bottom: 8px; }
.call-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: default;
}
.call-history-item:hover { background: #f5f5f5; }
.call-history-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.call-history-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-history-info { flex: 1; min-width: 0; }
.call-history-name { font-size: 15px; font-weight: 600; }
.call-history-meta { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.call-history-meta i { font-size: 12px; }
.call-history-item.missed .call-history-meta { color: #f44336; }
.call-history-item.missed .call-history-name { color: #f44336; }
.call-history-time { font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Live Popup (browser notification) */
.live-popup {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: #1a1a2e;
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  animation: livePopupIn 0.35s ease;
  max-width: 420px;
  width: calc(100% - 32px);
  border: 1px solid rgba(255,255,255,0.12);
}
@keyframes livePopupIn {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.live-popup-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 2px solid var(--danger); padding: 2px; background: #fff; }
.live-popup-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.live-popup-content { flex: 1; min-width: 0; }
.live-popup-name { font-size: 14px; font-weight: 700; }
.live-popup-name::after { content: " 🔴"; font-size: 11px; }
.live-popup-title { font-size: 12px; color: rgba(255,255,255,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-popup-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.live-popup-watch {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
}
.live-popup-watch:hover { transform: scale(1.05); }
.live-popup-close { background: rgba(255,255,255,0.15); color: #fff; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 13px; }
.live-popup-close:hover { background: rgba(255,255,255,0.3); }

/* Live Chat (emoji comments) */
.live-chat {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: calc(100% - 24px);
  z-index: 12;
  pointer-events: none;
}
.live-chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 8px;
  pointer-events: auto;
}
.live-chat-item {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: liveChatIn 0.3s ease;
  max-width: 85%;
}
@keyframes liveChatIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.live-chat-name { font-weight: 700; color: rgba(255,255,255,0.85); }
.live-chat-emoji { font-size: 24px; line-height: 1; }
.live-chat-text { word-break: break-word; }
.live-chat-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  pointer-events: auto;
}
.live-chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.live-chat-input:focus { border-color: rgba(255,255,255,0.6); }
.live-chat-input::placeholder { color: rgba(255,255,255,0.5); }
.live-chat-send {
  background: var(--danger);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-chat-send:hover { filter: brightness(1.15); }

/* Live emoji float overlay */
.live-emoji-float-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}
.live-emoji-float {
  position: absolute;
  bottom: 20%;
  font-size: 56px;
  text-shadow: 0 4px 16px rgba(0,0,0,0.6);
  animation: liveEmojiFloat 3s ease-out forwards;
}
@keyframes liveEmojiFloat {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  12% { opacity: 1; transform: translateY(0) scale(1.15); }
  25% { transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-220px) scale(1); }
}

/* Live Emoji bar */
.live-emoji-bar {
  display: flex;
  gap: 6px;
  pointer-events: auto;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border-radius: 24px;
  padding: 6px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
.live-emoji-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.live-emoji-btn:hover { transform: scale(1.3); }

/* Live Viewers side panel */
.live-side-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  max-width: 80%;
  background: rgba(26,26,46,0.95);
  backdrop-filter: blur(6px);
  z-index: 15;
  border-left: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  animation: liveSideIn 0.25s ease;
}
@keyframes liveSideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.live-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.live-side-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.live-viewer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #fff;
  font-size: 14px;
}
.live-viewer-item img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #fff; }

#chat-notif-container { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 380px); pointer-events: none; }
.chat-notif { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.98); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); cursor: pointer; pointer-events: auto; opacity: 0; transform: translateY(-12px); transition: opacity 0.25s, transform 0.25s; }
.chat-notif.show { opacity: 1; transform: translateY(0); }
.chat-notif-avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #e0e0e0; }
.chat-notif-body { flex: 1; min-width: 0; }
.chat-notif-name { font-weight: 700; font-size: 14px; color: var(--text); }
.chat-notif-text { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-notif-close { background: none; border: none; color: var(--text-secondary); padding: 4px 6px; cursor: pointer; font-size: 14px; }
.chat-notif-close:hover { color: var(--text); }

@media (max-width: 600px) {
  .live-popup { width: calc(100% - 16px); top: 8px; padding: 10px 12px; }
  .live-popup-watch { padding: 7px 10px; font-size: 12px; }
  .live-chat { left: 8px; bottom: 8px; width: calc(100% - 16px); }
  .live-side-panel { width: 100%; max-width: 100%; }
}