/* ==============================
   BASE — DRACULA THEME
============================== */
:root {
  --bg-main: #282a36;
  --bg-second: #44475a;

  --text-main: #f8f8f2;
  --text-accent: #50fa7b;
  --text-sub: #bd93f9;

  --btn-bg: #6272a4;
  --btn-hover: #50fa7b;
  --btn-text: #f8f8f2;

  --accent: #ff79c6;
  --highlight: #f1fa8c;
  --cyan: #8be9fd;

  --glass-bg: rgba(68, 71, 90, 0.45);
  --glass-border: rgba(255, 255, 255, 0.09);

  --font-main: "Poppins", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

/* ==============================
   EDIT BUTTON (PEN ICON)
============================== */
.edit-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--highlight);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.25s ease;
  backdrop-filter: blur(6px);
}

.edit-btn:hover {
  background: var(--highlight);
  color: #000;
  box-shadow: 0 0 10px var(--highlight);
  transform: scale(1.1);
}

.avatar-wrapper {
  position: relative;
  width: fit-content;
}

.edit-avatar {
  position: absolute;
  bottom: 6px;
  right: 6px;
}

.user-name-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==============================
   MODAL BASE
============================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

/* Fundo escuro */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

/* Conteúdo */
.modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px;
  z-index: 2;
  animation: modalIn 0.25s ease;
}

/* Título */
.modal-title {
  font-size: 1.4rem;
  color: var(--highlight);
  margin-bottom: 20px;
  text-align: center;
}

/* ==============================
   FORM
============================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--text-sub);
}

.form-group input[type="text"] {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(40, 42, 54, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8f8f2;
  outline: none;
}

.form-group input:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 0 2px rgba(241, 250, 140, 0.15);
}

/* ==============================
   AVATAR PREVIEW
============================== */
.avatar-edit-preview {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-edit-preview img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

/* ==============================
   ACTIONS
============================== */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==============================
   ANIMATION
============================== */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 700px) {
  .user-name-wrapper {
    justify-content: center;
  }

  .modal-content {
    max-width: 90%;
  }
}

.btn-show-more {
  margin: 20px auto;
  display: block;
  padding: 12px 26px;

  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.4px;

  color: #f8f8f2;
  background: #282a36;
  border: 2px solid #6272a4;

  border-radius: 12px;
  cursor: pointer;

  transition: all 0.25s ease;
  box-shadow: 0 0 8px rgba(98, 114, 164, 0.35);
}

.btn-show-more:hover {
  transform: translateY(-2px);
}

.btn-show-more:active {
  transform: translateY(0);
  box-shadow: 0 0 6px rgba(189, 147, 249, 0.5);
}

.auto-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag.gray {
  background: #44475a; /* Dracula */
  color: #f8f8f2;
}

.auto-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover; /* PREVIEW BONITO */
  border-radius: 12px;
  display: block;
}

/* Conteúdo do card  */
.auto-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Título com limite de linhas */
.auto-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  max-height: 2.6em; /* ~2 linhas */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  color: var(--highlight);
}

/* Linha de tags */
.auto-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tag de plataforma */
.platform-tag {
  text-transform: capitalize;
}

/* =========================
   CONTAINER DOS FILTROS
========================= */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

/* =========================
   SELECTS & INPUT
========================= */
#filter-platform,
#filter-sort,
#search-input {
  background: rgba(40, 42, 54, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f8f8f2;
  font-size: 14px;
  outline: none;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  min-width: 160px;
}

#search-input {
  flex: 1;
  min-width: 220px;
}

/* Placeholder */
#search-input::placeholder {
  color: rgba(248, 248, 242, 0.5);
}

/* Hover & Focus */
#filter-platform:hover,
#filter-sort:hover,
#search-input:hover {
  border-color: rgba(189, 147, 249, 0.6);
}

#filter-platform:focus,
#filter-sort:focus,
#search-input:focus {
  border-color: #bd93f9;
  box-shadow: 0 0 0 2px rgba(189, 147, 249, 0.15);
}

/* =========================
   SELECT CUSTOM ARROW
========================= */
#filter-platform,
#filter-sort {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23bd93f9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

/* =========================
   ACTIVE FILTERS (CHIPS)
========================= */
#active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* CHIP */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(189, 147, 249, 0.15);
  border: 1px solid rgba(189, 147, 249, 0.4);
  border-radius: 999px;
  font-size: 13px;
  color: #f8f8f2;
  animation: fadeInChip 0.25s ease;
}

/* BOTÃO X */
.filter-chip button {
  background: none;
  border: none;
  color: #ff79c6;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.filter-chip button:hover {
  transform: scale(1.2);
  opacity: 0.8;
}

/* =========================
   ANIMAÇÃO
========================= */
@keyframes fadeInChip {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 768px) {
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #filter-platform,
  #filter-sort,
  #search-input {
    width: 100%;
  }
}

/* Descrição */
.auto-description {
  position: relative;
  margin-top: 10px;
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.auto-description p {
  margin: 0;
  color: #ddd;
  line-height: 1.4;
  max-height: 3.8em; /* 3 linhas */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  transition: max-height 0.25s ease-in-out;
}

/* Quando expandir */
.auto-description p.expanded {
  max-height: 400px; /* altura grande para expandir */
  -webkit-line-clamp: unset;
}

.show-more-btn {
  margin-top: 5px;
  background: transparent;
  border: none;
  color: #8be9fd;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
  opacity: 0.8;
}

.show-more-btn:hover {
  opacity: 1;
}

.auto-desc {
  max-height: 4.5em; /* 3 linhas (1.5em cada) */
  line-height: 1.5em;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.auto-desc.expanded {
  max-height: 1000px; /* expande */
}

.show-more-btn {
  background: none;
  border: none;
  color: #8be9fd;
  cursor: pointer;
  margin: 5px 0 10px;
  padding: 0;
  font-size: 0.9rem;
}

.show-more-btn.hidden {
  display: none;
}

.auto-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* ==============================
   PREVIEW BUTTON (EYE ICON)
============================== */
.btn-preview {
  width: 34px;
  height: 34px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 121, 198, 0.12); /* accent glass */
  border: 1px solid rgba(255, 121, 198, 0.35);
  color: var(--accent);

  text-decoration: none;
  cursor: pointer;

  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.btn-preview i {
  font-size: 0.95rem;
}

/* Hover neon */
.btn-preview:hover {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 12px var(--accent);
  transform: scale(1.12);
}

/* Active (click) */
.btn-preview:active {
  transform: scale(1.05);
  box-shadow: 0 0 8px var(--accent);
}

/* button de publicar ou deletar*/
.btn-publish,
.btn-delete {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: 0.2s ease;
}

/* Published */
.btn-publish {
  background: #50fa7b22;
  color: #50fa7b;
  border: 1px solid #50fa7b33;
}

.btn-publish:hover {
  background: #50fa7b44;
}

/* Delete */
.btn-delete {
  background: #ff555522;
  color: #ff5555;
  border: 1px solid #ff555533;
}

.btn-delete:hover {
  background: #ff555544;
}

/* ==============================
   LAYOUT PRINCIPAL
============================== */
.dashboard-container {
  width: 90%;
  max-width: 1100px;
  margin: 40px auto 100px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ==============================
   GLASS EFFECT
============================== */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  border-radius: 18px;
  transition: 0.25s ease;
}

.glass:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.32);
}

/* ==============================
   PROFILE PANEL
============================== */
.profile-panel {
  padding: 35px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

#user-name {
  font-size: 1.7rem;
  font-weight: 600;
}

#user-email {
  color: var(--text-sub);
}

.user-plan span {
  color: var(--highlight);
  font-weight: 700;
}

/* ==============================
   PROFILE ACTION BUTTONS
============================== */
.profile-actions {
  margin-top: 25px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

/* BTN padrão + neon glow */
.btn {
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  background: var(--btn-hover);
  color: #000;
}

.glow {
  box-shadow: 0 0 10px var(--btn-bg);
}

.glow:hover {
  box-shadow: 0 0 16px var(--highlight);
}

.red {
  background: #ff4b6e;
}

.red:hover {
  background: #ff1f53;
  color: #000;
}

/* Small buttons */
.small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ==============================
   SECTIONS
============================== */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title {
  font-size: 1.4rem;
  color: var(--cyan);
  font-weight: 600;
}

/* ==============================
   CARDS GRID
============================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

@media (min-width: 1600px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* Card */
.card {
  padding: 22px;
  border-left: 4px solid var(--accent);
}

.card h4 {
  color: var(--highlight);
  margin-bottom: 8px;
}

.card p {
  margin-bottom: 12px;
  color: var(--text-main);
}

/* Tags */
.tag {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.green {
  background: #2ecc71;
  color: #000;
}

.yellow {
  background: #f1c40f;
  color: #000;
}

/* Área esquerda do header */
.profile-info-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Container geral */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =============================
   BADGE DO PLANO
============================= */
.plan-badge {
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid transparent;
  transition: 0.25s ease;
  user-select: none;
}

/* FREE — básico */
.badge-free {
  background: #44475a;
  color: #f8f8f2;
  border-color: #6272a4;
}

/* PRO — neon verde */
.badge-pro {
  background: rgba(80, 250, 123, 0.15);
  color: #50fa7b;
  border-color: #50fa7b;
  box-shadow: 0 0 10px #50fa7b;
}

/* ULTRA — neon rosa */
.badge-premium {
  background: rgba(255, 121, 198, 0.18);
  color: #ff79c6;
  border-color: #ff79c6;
  box-shadow: 0 0 12px #ff79c6;
}

/* MASTER — amarelo neon */
.badge-master {
  background: rgba(241, 250, 140, 0.18);
  color: #f1fa8c;
  border-color: #f1fa8c;
  box-shadow: 0 0 12px #f1fa8c;
}

/* Responsivo */
@media (max-width: 700px) {
  .profile-header {
    flex-direction: column;
    gap: 20px;
  }
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 700px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-actions {
    justify-content: center;
  }

  .dashboard-container {
    margin-top: 20px;
  }
}
