/* ============================================
   COMPONENTS — Botões, Cards, Forms, etc.
   ============================================ */

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .icon-svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--grad-gold);
  color: var(--navy-dark);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(201,168,76,0.3);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-gold-lg);
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(217,64,64,0.4);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(217,64,64,0.12);
  border-color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 10px rgba(61,170,106,0.3);
}

.btn-sm   { padding: 0.45rem 0.875rem; font-size: 0.78rem; }
.btn-lg   { padding: 0.9rem 2rem; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 0.625rem; border-radius: var(--radius-md); }
.btn-icon .icon-svg { width: 18px; height: 18px; }

.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.4rem;
}

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
}

.card-hover:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-gold {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.card-title { font-weight: 700; font-size: 1rem; }
.card-subtitle { color: var(--text-muted); font-size: 0.8rem; }
.card-icon {
  width: 40px; height: 40px;
  background: var(--gold-muted);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 1.125rem;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.2px;
}
.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  font-family: inherit;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-muted);
  background: var(--surface-3);
}
.form-control::placeholder { color: var(--text-muted); font-size: 0.85rem; }
.form-control:disabled { opacity: 0.45; cursor: not-allowed; }

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23B0B8C8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.375rem;
}
.form-hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.375rem; }

/* Checkbox / Radio */
.check-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.check-item:hover { border-color: var(--border); }
.check-item.selected { border-color: var(--gold); background: var(--gold-muted); }
.check-item input { display: none; }
.check-item-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.check-item-text { flex: 1; }
.check-item-label { font-weight: 500; font-size: 0.9rem; }
.check-item-desc { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

/* Range slider */
.range-wrapper {
  padding: 0.5rem 0;
}
input[type=range] {
  width: 100%;
  appearance: none;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: var(--shadow-gold);
}

/* File input */
.file-input-wrapper {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}
.file-input-wrapper:hover { border-color: var(--gold); background: var(--gold-muted); }
.file-input-wrapper input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.file-input-icon { color: var(--gold); margin-bottom: 0.75rem; display: flex; justify-content: center; }
.file-input-icon .icon-svg { width: 36px; height: 36px; }
.file-input-text { color: var(--text-secondary); font-size: 0.875rem; }
.file-input-hint { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.25rem; }

/* ============ PROGRESS BAR ============ */
.progress-bar-wrap {
  background: var(--surface-3);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 10px;
  transition: width 0.6s ease;
}
.progress-bar-fill.green { background: linear-gradient(90deg, #2E7D32, var(--success)); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.25rem;
}
.badge-gold { background: var(--gold-muted); color: var(--gold); }
.badge-navy { background: var(--surface-3); color: var(--text-secondary); }
.badge-success { background: rgba(76,175,80,0.15); color: var(--success); }
.badge-danger { background: rgba(244,67,54,0.15); color: var(--danger); }
.badge-premium { background: linear-gradient(135deg, var(--gold-muted), rgba(212,175,55,0.25)); color: var(--gold); border: 1px solid var(--border); }

/* ============ TAGS ============ */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tag {
  padding: 0.25rem 0.75rem;
  background: var(--surface-3);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ============ AVATAR ============ */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 64px; height: 64px; border-width: 3px; }
.avatar-xl { width: 96px; height: 96px; border-width: 4px; }

.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border: 2px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ============ STREAK / STAT BOXES ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem 0.75rem;
  text-align: center;
  transition: var(--transition);
}
.stat-box:hover { border-color: var(--border); }
.stat-box .stat-value {
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.stat-box .stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============ MEDAL ============ */
.medal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.medal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 80px;
  text-align: center;
}
.medal-item.earned { border-color: var(--gold); background: var(--gold-muted); }
.medal-item.locked { opacity: 0.4; filter: grayscale(1); }
.medal-icon-wrap {
  width: 44px; height: 44px;
  background: var(--gold-muted);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.375rem;
  color: var(--gold);
}
.medal-icon-wrap .icon-svg { width: 22px; height: 22px; }
.medal-name { font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); }

/* Modal type icon (marriage, etc.) */
.modal-type-icon {
  width: 72px; height: 72px;
  background: var(--gold-muted);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--gold);
}
.modal-type-icon .icon-svg { width: 36px; height: 36px; }

/* ============ TABS ============ */
.tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0.2rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--border-subtle);
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  min-width: max-content;
  padding: 0.55rem 0.875rem;
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  background: var(--grad-gold);
  color: var(--navy-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(201,168,76,0.25);
}

/* ============ LIST ITEMS ============ */
.list-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 0.375rem;
}
.list-item:hover { border-color: var(--border); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.list-item.completed { opacity: 0.65; }
.list-item .li-icon {
  width: 36px; height: 36px;
  background: var(--gold-muted);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.list-item .li-icon .icon-svg { width: 18px; height: 18px; }
.list-item .li-content { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-subtitle { font-size: 0.775rem; color: var(--text-muted); margin-top: 2px; }
.list-item .li-right { flex-shrink: 0; color: var(--text-muted); }
.list-item .li-right .icon-svg { width: 16px; height: 16px; }

/* ============ SPINNER ============ */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.spinner-center { display: flex; justify-content: center; padding: 2rem; }

/* ============ AUDIO PLAYER ============ */
.audio-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}
.audio-player audio { width: 100%; margin-top: 0.5rem; }
audio::-webkit-media-controls-panel { background: var(--surface-2); }

/* ============ VIDEO PLAYER ============ */
.video-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
}
.video-container video { width: 100%; height: 100%; }

/* ============ DRAG HANDLE ============ */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 0 0.5rem;
  font-size: 1.2rem;
}
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: 0.5; border: 2px dashed var(--gold); }
.drag-over { border-top: 2px solid var(--gold); }

/* ============ NOTIFICATION DOT ============ */
.notif-dot {
  position: relative;
}
.notif-dot::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--navy);
}

/* ============ TIER BADGE ============ */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan-free { background: var(--surface-3); color: var(--text-muted); }
.plan-premium { background: var(--gold-muted); color: var(--gold); border: 1px solid var(--border); }

/* ============ LOCKED OVERLAY ============ */
.locked-overlay {
  position: relative;
  overflow: hidden;
}
.locked-overlay::after {
  content: 'Premium';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--grad-gold);
  color: var(--navy-dark);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.locked-overlay .locked-content { filter: blur(4px); pointer-events: none; user-select: none; }

/* ============ SEARCH BAR ============ */
.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}
.search-bar-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}
.search-bar input {
  padding-left: 2.75rem;
}

/* Responsive helpers */
@media (max-width: 480px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}
