/* ===== RESET GLOBAL ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0b0c10;
  color: #ffffff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(24, 24, 27, 0.9);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

header img {
  max-height: 36px;
  max-width: 120px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.open-sidebar-btn {
  background: linear-gradient(45deg, #00aaff, #ff00aa);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 170, 255, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.open-sidebar-btn.edit-btn {
  background: linear-gradient(45deg, #ff00aa, #00aaff);
}

.open-sidebar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 0, 170, 0.6);
}

.home-icon {
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.home-icon:hover {
  color: #00aaff;
}

/* ===== OVERLAY DE SUPERPOSICIÓN (#edit) ===== */
.edit-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10005;
}

.edit-backdrop.show {
  display: block;
}

#edit.edit-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  background: rgba(18, 18, 24, 0.95);
  border: 1px solid rgba(0, 170, 255, 0.3);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(0, 170, 255, 0.25), 0 15px 35px rgba(0, 0, 0, 0.8);
  z-index: 10010;
  overflow-y: auto;
  padding: 20px;
  transition: all 0.3s ease;
}

#edit.edit-modal.show {
  display: block;
  transform: translate(-50%, -50%) scale(1);
}

.edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.edit-header h2 {
  font-size: 18px;
  color: #00aaff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-edit {
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
}

.close-edit:hover {
  color: #ff00aa;
}

.edit-group {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.edit-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 8px;
}

/* ===== CONTENEDOR PRINCIPAL PERFIL ===== */
#panel-home0 {
  position: relative;
  max-width: 680px;
  margin: 30px auto;
  padding: 20px;
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
}

/* ===== PORTADA ===== */
.cover-container {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 14px;
  overflow: visible;
  margin-bottom: 70px;
  background: #18181c;
}

.cover-photo, 
.cover-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  position: absolute;
  top: 0;
  left: 0;
}

.cover-upload-btn {
  display: inline-block;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease;
  text-align: center;
}

.cover-upload-btn:hover {
  background: rgba(0, 170, 255, 0.8);
}

/* ===== AVATAR Y MARCOS ===== */
#profile-photo-container {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #141419;
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
  z-index: 10;
  background: #1e1e24;
}

#profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.frame {
  position: absolute;
  top: -12%;
  left: -12%;
  width: 124%;
  height: 124%;
  pointer-events: none;
  display: none;
  z-index: 11;
}

/* ===== BOTÓN SUBIR FOTO ===== */
.upload-button {
  display: inline-block;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #00aaff;
  background: rgba(0, 170, 255, 0.1);
  border: 1px solid #00aaff;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.upload-button:hover {
  background: #00aaff;
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 170, 255, 0.4);
}

/* ===== COLOR VIP ===== */
#vip-color-box {
  display: none;
  margin: 15px 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 170, 255, 0.2);
}

.vip-color-picker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.vip-color-picker label {
  color: #ccc;
  font-size: 13px;
}

#vip-name-color-input {
  border: none;
  width: 40px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

#save-name-color-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(45deg, #00aaff, #ff00aa);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}

/* ===== DATOS DEL USUARIO ===== */
.user-info-section {
  margin: 15px 0;
  font-size: 14px;
}

.user-info-section p {
  margin: 8px 0;
  color: #ddd;
}

.glow-name {
  font-weight: bold;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* ESTRUCTURA Y ESTILOS PARA INSIGNIAS */
.user-badges-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.insignias {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.insignia {
  display: inline-flex;
  align-items: center;
  background: #1c1c22;
  border: 1px solid rgba(0, 170, 255, 0.3);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: 0 0 6px rgba(0, 170, 255, 0.2);
}

.insignia img {
  width: 14px;
  height: 14px;
  margin-right: 5px;
}

/* ===== BIOGRAFÍA Y VISTA DE USUARIO ===== */
.profile-section {
  text-align: left;
}

.profile-section label {
  font-size: 13px;
  font-weight: 600;
  color: #aaa;
  display: block;
  margin-bottom: 8px;
}

.profile-section textarea {
  width: 100%;
  height: 75px;
  padding: 10px;
  border-radius: 8px;
  background: #101014;
  border: 1px solid #2a2a30;
  color: #fff;
  font-size: 13px;
  resize: vertical;
}

.profile-section button {
  background: #00aaff;
  color: #fff;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: background 0.2s ease;
}

.profile-section button:hover {
  background: #0088cc;
}

.profile-section-view {
  margin: 20px auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.profile-section-view h3 {
  font-size: 14px;
  color: #00aaff;
  margin-bottom: 8px;
}

.profile-section-view p {
  font-size: 13px;
  color: #ccc;
  line-height: 1.4;
  white-space: pre-wrap;
}

#discord-boost-history {
  color: #aaa;
  font-size: 12px;
  margin-top: 15px;
  cursor: pointer;
}

#boost-count {
  color: #ff00aa;
  font-weight: bold;
}

/* ===== SIDEBAR / OVERLAY CONFIGURACIÓN ===== */
.sidebar {
  position: fixed;
  right: -340px;
  top: 0;
  width: 320px;
  height: 100%;
  background: #121216;
  color: #fff;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
  box-shadow: -5px 0 25px rgba(0,0,0,0.8);
  z-index: 10001;
  overflow-y: auto;
}

.sidebar.show { right: 0; }

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
  padding-bottom: 12px;
  margin-bottom: 15px;
}

.sidebar-header h2 {
  font-size: 16px;
  color: #00aaff;
}

.close-sidebar {
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

.close-sidebar:hover { color: #fff; }

.sidebar-divider {
  border: 0;
  height: 1px;
  background: #222;
  margin: 20px 0;
}

.sidebar-content h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #ddd;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
}

.overlay.show { display: block; }

/* REJILLAS */
#photo-frames {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.frame-option {
  text-align: center;
  background: #18181e;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #25252e;
}

.photo-frame {
  width: 48px;
  height: 48px;
  object-fit: contain;
  cursor: pointer;
}

.photo-frame.locked { opacity: 0.4; cursor: not-allowed; }

.frame-text {
  font-size: 10px;
  margin-top: 4px;
  font-weight: 600;
}

.frame-text.free { color: #4caf50; }
.frame-text.locked { color: #f44336; }
.frame-text.unlocked { color: #00e676; }

#animation-options-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.animation-option {
  padding: 10px 6px;
  text-align: center;
  border: 1px solid #282832;
  border-radius: 8px;
  background: #18181e;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.animation-option:hover {
  border-color: #00aaff;
  transform: translateY(-2px);
}

.animation-option.selected {
  border-color: #00e676;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.3);
}

.animation-option.locked { opacity: 0.4; cursor: not-allowed; }

/* ANIMACIONES */
.animation-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: rgba(0,0,0,0.5);
}