/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface-2: #24243a;
  --border: #2e2e4a;
  --text: #e8e8f0;
  --text-muted: #8888a8;
  --primary: #6c5ce7;
  --primary-hover: #5a4bd1;
  --accent: #fd79a8;
  --danger: #e74c3c;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* ===== LOGO ===== */
.logo {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.logo span, .logo-small span { color: var(--primary); }
.logo-small { font-size: 1.3rem; font-weight: 700; }

/* ===== AUTH ===== */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 1.5rem;
}
.auth-card input {
  width: 100%;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}
.auth-card input:focus { border-color: var(--primary); }

/* ===== BOTÕES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-bottom: 0.6rem;
}
.btn.small { padding: 0.5rem 1rem; font-size: 0.85rem; width: auto; margin: 0; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--primary); }
.btn.ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn.ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn.google { background: #fff; color: #333; }
.btn.google:hover { background: #eee; }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error-msg {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: left;
}

/* ===== APP LAYOUT ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-right { display: flex; align-items: center; gap: 0.8rem; }
.avatar-small { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }

.app-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.nav-btn {
  padding: 0.5rem 1.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-btn.active { background: var(--primary); color: #fff; }
.nav-btn:hover:not(.active) { color: var(--text); background: var(--surface-2); }

.tab-content { display: none; padding: 1.5rem; max-width: 680px; margin: 0 auto; }
.tab-content.active { display: block; }

/* ===== FEED ===== */
.feed { display: flex; flex-direction: column; gap: 1rem; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: border 0.2s;
}
.post-card:hover { border-color: var(--primary); }

.post-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.post-header img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.post-header .post-author { font-weight: 600; font-size: 0.95rem; }
.post-header .post-time { color: var(--text-muted); font-size: 0.8rem; }

.post-text { margin-bottom: 0.8rem; white-space: pre-wrap; }
.post-image { width: 100%; border-radius: var(--radius-sm); margin-bottom: 0.8rem; max-height: 400px; object-fit: cover; }

.post-actions {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.post-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.post-action:hover { color: var(--primary); }
.post-action.liked { color: var(--accent); }

/* ===== COMENTÁRIOS ===== */
.comments-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.comment { display: flex; gap: 0.6rem; margin-bottom: 0.8rem; }
.comment img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.comment-body { flex: 1; }
.comment-author { font-weight: 600; font-size: 0.85rem; }
.comment-text { font-size: 0.9rem; color: var(--text); }
.comment-time { font-size: 0.75rem; color: var(--text-muted); }

.comment-input-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.comment-input-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}
.comment-input-row input:focus { border-color: var(--primary); }

/* ===== PERFIL ===== */
.profile-bg {
  height: 200px;
  border-radius: var(--radius);
  background: var(--primary);
  background-size: cover;
  background-position: center;
  margin-bottom: -50px;
}
.profile-info {
  text-align: center;
  padding: 0 1rem;
  position: relative;
}
.avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  margin-bottom: 0.8rem;
}
.bio { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.8rem; }
.music-player {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem auto;
  max-width: 400px;
}

/* ===== MODAIS ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h3 { margin-bottom: 1rem; }
.modal-content label { display: block; font-size: 0.85rem; color: var(--text-muted); margin: 0.8rem 0 0.3rem; }
.modal-content input[type="text"],
.modal-content input[type="url"],
.modal-content input[type="color"],
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.modal-content textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; gap: 0.8rem; margin-top: 1.2rem; }
.modal-actions .btn { margin-bottom: 0; }

.preview img { max-width: 100%; max-height: 120px; border-radius: var(--radius-sm); margin-top: 0.5rem; }

/* ===== LOADER ===== */
.loader { text-align: center; color: var(--text-muted); padding: 1rem; font-size: 0.9rem; }
.load-more { display: block; margin: 1rem auto; max-width: 200px; }
.feed-end { text-align: center; color: var(--text-muted); padding: 1.5rem; font-size: 0.9rem; }

/* ===== RESPONSIVO ===== */
@media (max-width: 600px) {
  .app-header { padding: 0.6rem 1rem; }
  .app-nav { padding: 0.6rem 1rem; }
  .tab-content { padding: 1rem; }
  .post-actions { gap: 1rem; }
}