/* ==========================================
   SISTEMA DE TEMAS — DARK & LIGHT MODE
   ========================================== */

/* ── Transição global ao trocar tema ── */
*,
*::before,
*::after {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

/* Exceção: não transicionar transforms/opacity (prejudica animações do feed) */
.feed-card,
.feed-card-img,
.feed-card-overlay,
.modal-backdrop,
.modal-box,
.reveal {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.5s ease,
    transform 0.4s ease;
}

/* ==========================================
   LIGHT MODE — variáveis
   ========================================== */

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-modal: #ffffff;
  --border: #e5e5e5;
  --border-light: #d4d4d4;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.1);

  --text-primary: #0a0a0a;
  --text-secondary: #525252;
  --text-muted: #a3a3a3;

  --shadow-card: 0 1px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   AJUSTES ESPECÍFICOS LIGHT MODE
   ========================================== */

[data-theme="light"] .site-header {
  background: rgba(250, 250, 250, 0.9);
  border-bottom-color: #e5e5e5;
}

[data-theme="light"] .feed-card-placeholder {
  background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
}

[data-theme="light"] .placeholder-icon,
[data-theme="light"] .placeholder-title {
  color: #3b82f6;
}

[data-theme="light"] .placeholder-title {
  color: #374151;
}

[data-theme="light"] .modal-img-placeholder {
  background: linear-gradient(135deg, #e8f0fe, #dbeafe);
}

[data-theme="light"] .modal-img-placeholder .modal-placeholder-title {
  color: #374151;
}

[data-theme="light"] .profile-avatar-fallback {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

[data-theme="light"] .filter-btn {
  background: #f5f5f5;
  color: #525252;
}

[data-theme="light"] .filter-btn:hover {
  background: #e5e5e5;
  color: #0a0a0a;
}

[data-theme="light"] .sobre-card {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .feed-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-nav-btn {
  background: #f5f5f5;
  border-color: #e5e5e5;
}

[data-theme="light"] .modal-nav-btn:hover:not(:disabled) {
  background: #e5e5e5;
}

[data-theme="light"] .modal-close {
  background: #f5f5f5;
}

[data-theme="light"] .modal-close:hover {
  background: #e5e5e5;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f5f5f5;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d4d4d4;
}

/* ==========================================
   BOTÃO DE TOGGLE DO TEMA
   ========================================== */

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform 0.2s ease !important;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--border);
  color: var(--text-primary);
  transform: rotate(20deg) scale(1.05) !important;
}

.theme-toggle:active {
  transform: scale(0.92) !important;
}

/* Ícone do tema — dark = lua, light = sol */
.theme-toggle .icon-dark,
.theme-toggle .icon-light {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.3s ease;
  line-height: 1;
}

.theme-toggle .icon-dark  { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle .icon-light { opacity: 0; transform: rotate(-90deg) scale(0.5); }

[data-theme="light"] .theme-toggle .icon-dark  { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .theme-toggle .icon-light { opacity: 1; transform: rotate(0deg) scale(1); }

/* ==========================================
   BANNER DE TEMA (toast ao trocar)
   ========================================== */

.theme-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  z-index: 500;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease !important;
  white-space: nowrap;
  pointer-events: none;
}

.theme-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
