* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #03000b;
  --bg-soft: #0a0015;
  --accent: #b400ff;
  --accent-strong: #ff00ff;
  --accent-soft: rgba(180, 0, 255, 0.18);
  --text: #ffffff;
  --text-soft: #a6a1c8;
  --border: #26113a;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.9);
  --spacing: 16px;
  --transition: 0.2s ease;
  --sidebar-width: 260px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, #3c0080 0, transparent 40%),
    radial-gradient(circle at bottom, #12001f 0, #020006 60%);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* animação geral */
@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app {
  display: flex;
  height: 100vh;
}

/* SIDEBAR */

.sidebar {
  width: var(--sidebar-width);
  background: radial-gradient(circle at top left, #2a004d, #03000b);
  border-right: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: float-up 0.4s ease-out;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo-icon {
  background: radial-gradient(circle at 30% 30%, #ffffff, #b400ff 40%, #ff00ff);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 12px 30px rgba(255, 0, 255, 0.6);
}

.logo-text {
  font-size: 18px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-soft);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition), color var(--transition),
    transform var(--transition), box-shadow var(--transition);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transform: translateX(2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.15), rgba(74, 0, 155, 0.5));
  color: #ffffff;
}

/* FOOTER SIDEBAR */

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--text-soft);
  opacity: 0.7;
}

/* FEED */

.feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  overflow: hidden;
}

/* TOPBAR */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  animation: float-up 0.35s ease-out;
}

.tabs {
  display: flex;
  background: rgba(6, 1, 16, 0.95);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid rgba(208, 132, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-soft);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    transform var(--transition), box-shadow var(--transition);
}

.tab.active {
  background: radial-gradient(circle at top, #ff00ff, #7a00ff);
  color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(255, 0, 255, 0.5);
}

.search-area {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-area input {
  width: min(260px, 100%);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(5, 0, 15, 0.9);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.search-area input::placeholder {
  color: var(--text-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* BOTÕES */

.btn-primary,
.btn-outline,
.btn-google,
.btn-facebook {
  border-radius: var(--radius-full);
  border: none;
  outline: none;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition),
    border-color var(--transition), opacity var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary {
  background: radial-gradient(circle at top, #ff00ff, #7a00ff);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(255, 0, 255, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(255, 0, 255, 0.7);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* login */

.btn-google {
  background: #ffffff;
  color: #000000;
}

.btn-google::before {
  content: "G";
  font-weight: 700;
}

.btn-facebook {
  background: #1877f2;
  color: #ffffff;
}

.btn-facebook::before {
  content: "f";
  font-weight: 900;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-area.hidden {
  display: none;
}

.auth-user-info {
  font-size: 12px;
  color: var(--text-soft);
}

/* PROFILE TABS */

.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-tabs.hidden {
  display: none;
}

.profile-tab {
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  padding: 6px 12px;
  background: rgba(5, 0, 12, 0.8);
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), box-shadow var(--transition);
}

.profile-tab.active {
  background: radial-gradient(circle at top, #ff00ff, #7a00ff);
  color: #000000;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 0, 255, 0.5);
}

/* cabeçalho perfil público */

.public-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.public-profile-header span {
  font-weight: 500;
}

.public-profile-header.hidden {
  display: none;
}

/* VIDEO LIST & CARD */

.video-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  scroll-behavior: smooth;
}

.load-more-wrapper {
  display: flex;
  justify-content: center;
  padding-bottom: 10px;
}

.video-card {
  position: relative;
  width: min(430px, 100%);
  height: 76vh;
  border-radius: 26px;
  background: radial-gradient(circle at top, #3d0063, #06000f);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  opacity: 0;
  transform: translateY(16px) scale(0.99);
  animation: float-up 0.35s ease-out forwards;
}

.video-card-inner {
  flex: 1;
  display: flex;
}

.video-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
}

.video-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* OVERLAYS */

.video-overlay-top,
.video-overlay-bottom {
  position: absolute;
  inset-inline: 0;
  height: 26%;
  pointer-events: none;
}

.video-overlay-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(4, 0, 12, 0.9), transparent);
}

.video-overlay-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(4, 0, 12, 0.95), transparent 55%);
}

/* INFO DO VÍDEO */

.video-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-user-clickable {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: radial-gradient(circle at 30% 20%, #fff8, #5d00b3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.follow-btn {
  margin-left: auto;
  border-radius: var(--radius-full);
  border: none;
  padding: 4px 10px;
  font-size: 11px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), opacity var(--transition), border-color var(--transition);
}

.follow-btn.following {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--accent-strong);
}

.video-caption {
  font-size: 13px;
  line-height: 1.4;
  max-height: 3.2em; /* ~2 linhas */
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-music {
  font-size: 12px;
  color: var(--text-soft);
}

/* AÇÕES LATERAIS */

.video-actions {
  width: 72px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition), opacity var(--transition);
}

.action-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.action-label {
  font-size: 11px;
}

.action-btn.liked .action-icon {
  background: radial-gradient(circle at top, #ff00ff, #7a00ff);
  border-color: transparent;
}

.action-btn.liked .action-label {
  color: var(--accent-strong);
}

.action-btn.saved .action-icon {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
}

/* PLAY INDICATOR */

.play-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.play-indicator-icon {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 22px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.play-indicator.visible .play-indicator-icon {
  opacity: 1;
  transform: scale(1);
}

/* MODAIS */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 0, 8, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  width: min(440px, 92%);
  background: radial-gradient(circle at top, #2a004d, #05000c);
  border-radius: 24px;
  padding: 20px 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(208, 132, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: float-up 0.25s ease-out;
}

.modal h2 {
  font-size: 18px;
}

.modal p {
  font-size: 13px;
  color: var(--text-soft);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.modal input[type="text"],
.modal input[type="file"],
.modal textarea {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #05000e;
  color: var(--text);
  font-size: 13px;
}

/* Comentários */

.modal-comments {
  max-height: 80vh;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comments-video-info {
  font-size: 12px;
  color: var(--text-soft);
}

.comments-list {
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-item {
  font-size: 13px;
  line-height: 1.3;
}

.comment-author {
  font-weight: 600;
  margin-right: 4px;
}

.comment-date {
  font-size: 11px;
  color: var(--text-soft);
  margin-left: 4px;
}

.comments-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* barra de upload */

.upload-progress {
  width: 100%;
  height: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff00ff, #7a00ff);
  transition: width 0.1s linear;
}

/* UTIL */

.hidden {
  display: none !important;
}

/* RESPONSIVO */

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .feed {
    padding-inline: 10px;
  }

  .topbar {
    gap: 8px;
  }

  .search-area {
    display: none;
  }

  .video-card {
    width: 100%;
    height: 80vh;
  }
}


/* ===== PERFIL (cabeçalho) ===== */
.profile-header {
  background: radial-gradient(circle at top, #2a004d, #05000c);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(208, 132, 255, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.profile-header.hidden {
  display: none;
}

.profile-header-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.profile-avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.hidden-input-file {
  display: none;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  border: 2px solid #ffffff;
  background: radial-gradient(circle at 30% 20%, #fff8, #5d00b3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background-size: cover;
  background-position: center;
}

.profile-avatar span {
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-avatar.has-image span {
  display: none;
}

.profile-avatar-edit {
  font-size: 11px;
  color: var(--text-soft);
  text-decoration: underline;
}

.profile-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-header-info label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-header-info input,
.profile-header-info textarea {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #05000e;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
}

.profile-header-stats {
  display: flex;
  gap: 18px;
  margin-top: 4px;
}

.profile-header-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  font-weight: 700;
  font-size: 14px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .profile-header {
    margin-top: 6px;
  }
  .profile-header-main {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ===== Perfil: modo display x edição ===== */

.profile-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-display-name {
  font-weight: 700;
  font-size: 14px;
}

.profile-display-bio {
  font-size: 12px;
  color: var(--text-soft);
  white-space: pre-line;
}

.profile-edit-form.hidden {
  display: none;
}

.profile-edit-actions {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .profile-display-name {
    font-size: 13px;
  }
}


/* -------- PERFIL NOVO (v7) -------- */

.profile-header {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.profile-header.hidden {
  display: none;
}

/* CAPA */
.profile-cover {
  display: none;
  width: 100%;
  height: 0;
}

@keyframes neonMove {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(70deg); }
}

/* BLOCO PRINCIPAL */
.profile-main {
  padding: 15px;
  display: flex;
  gap: 20px;
  margin-top: 10px;
  align-items: flex-start;
}

/* FOTO */
.profile-photo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.profile-photo {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  background: #111;
  border: 3px solid #b24aff;
  box-shadow: 0 0 14px #b24aff88;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 34px;
  color: white;
  background-size: cover;
  background-position: center;
}

.profile-photo.has-image span {
  display: none;
}

.change-photo {
  margin-top: 5px;
  font-size: 12px;
  color: #ccc;
}

/* INFO */
.profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-info h2 {
  font-size: 20px;
  font-weight: 700;
}

.profile-bio {
  color: #dcdcdc;
  font-size: 14px;
}

/* BOTÕES */
.btn-edit-profile {
  align-self: flex-start;
  background: #6a00ff;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  color: white;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 4px;
}

.btn-edit-profile:hover {
  background: #8b2cff;
}

.profile-edit-form.hidden {
  display: none;
}

.btn-save-profile {
  background: #00ff95;
  color: black;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.2s;
}

.btn-save-profile:hover {
  background: #00ffaa;
}

/* CONTADORES */
.profile-stats {
  display: flex;
  gap: 25px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.profile-stats div {
  text-align: center;
  background: #0c0016;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #4a006f;
  box-shadow: 0 0 8px #4a006f88;
}

.profile-stats span {
  font-weight: 700;
  font-size: 17px;
}

.profile-stats p {
  font-size: 12px;
  color: #ccc;
}

@media (max-width: 900px) {
  .profile-main {
    flex-direction: column;
    margin-top: -40px;
  }
}

/* -------- COMENTÁRIOS AVANÇADOS (v7) -------- */

.comment-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, #fff8, #5d00b3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.comment-avatar.has-image {
  color: transparent;
}

.comment-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
}

.comment-text {
  font-size: 13px;
}

.comment-reply-btn {
  background: transparent;
  border: none;
  color: #ff2bd6;
  font-size: 11px;
  cursor: pointer;
}

.comment-replies {
  margin-left: 32px;
  margin-top: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 8px;
}

.comment-reply-info {
  font-size: 12px;
  margin: 4px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-reply-info.hidden {
  display: none;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 999px;
}

/* Grid de vídeos no perfil */
.profile-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  padding: 10px 0 20px;
}

.profile-video-item {
  background: #12001f;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #3f0070;
  box-shadow: 0 0 10px rgba(178, 74, 255, 0.3);
}

.profile-video-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
