/* ==========================================================================
   GetMoney - Internal App Styles (Dashboard, Sidebar, Auth, etc.)
   Depends on: /assets/css/landing.css (Design System / Variables)
   ========================================================================== */

/* ── Backward Compatibility (velhas variáveis → novas do Design System) ── */
:root {
  --bg-dark:             var(--bg-main,       #0B0F19);
  --bg-card:             var(--glass-bg,      rgba(17, 24, 39, 0.7));
  --bg-card-hover:       var(--bg-tertiary,   #1F2937);
  --primary-green:       var(--brand-primary, #00E676);
  --primary-green-hover: var(--brand-primary-hover, #00C853);
  --accent-yellow:       #F59E0B;
  --text-main:           var(--text-primary,  #F8FAFC);
  --border-color-app:    var(--border-color,  rgba(255,255,255,0.08));
  --danger:              #EF4444;

  --sidebar-width:  260px;
  --header-height:   68px;
  --glass-blur:      blur(16px);
  --transition:      all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-md:       12px;
  --radius-lg:       16px;
  --radius-full:     9999px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[data-theme="dark"] body,
[data-theme="dark"] {
  background: radial-gradient(ellipse at top left, #111827 0%, #0B0F19 70%);
}
[data-theme="light"] body,
[data-theme="light"] {
  background: var(--bg-secondary);
}

a { color: var(--primary-green); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-primary-hover, #00C853); }

/* ── GLASS PANEL ── */
.glass-panel {
  background: var(--glass-bg, rgba(17,24,39,0.6));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.06));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.glass-panel:hover {
  border-color: rgba(255,255,255,0.12);
}

/* ── DROPDOWNS (sem transparência — fundo sólido) ── */
#notif-dropdown,
#user-dropdown {
  background: var(--bg-secondary, #111827) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--border-color-app, rgba(255,255,255,0.1)) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4) !important;
}
/* Light theme override */
[data-theme="light"] #notif-dropdown,
[data-theme="light"] #user-dropdown {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08) !important;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary-green);
  color: #000;
  box-shadow: 0 4px 16px rgba(0, 230, 118, 0.3);
}
.btn-primary:hover {
  background: var(--primary-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.45);
  color: #000;
}
.btn-accent {
  background: var(--accent-yellow);
  color: #000;
}
.btn-accent:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color-app);
  color: var(--text-main);
}
.btn-outline:hover { background: var(--bg-card-hover); border-color: var(--text-main); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary, #94A3B8);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-tertiary, rgba(15,23,42,0.6));
  border: 1px solid var(--border-color-app);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.12);
}
select.form-control { cursor: pointer; }

/* ── APP LAYOUT ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─────────── SIDEBAR (removed) ─────────── */
.sidebar { display: none !important; }

/* ─────────── MAIN CONTENT ─────────── */
.main-content {
  flex: 1;
  margin-left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* ─────────── TOP HEADER ─────────── */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: var(--header-height);
  border-radius: 0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  background: var(--bg-main, #0B0F19) !important;
  border-bottom: 1px solid var(--border-color-app) !important;
  margin-bottom: 0;
}
.top-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.user-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-balance {
  background: rgba(0, 230, 118, 0.1);
  color: var(--primary-green);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 230, 118, 0.25);
  font-variant-numeric: tabular-nums;
}

/* ─────────── CONTENT AREA ─────────── */
.page-content {
  padding: 2rem;
  flex: 1;
}

/* ─────────── DASHBOARD GRID ─────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 992px) {
  .dashboard-chart-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* STAT CARDS */
.stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color-app);
  border-radius: var(--radius-lg);
  background: var(--glass-bg, rgba(17,24,39,0.6));
  backdrop-filter: var(--glass-blur);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--primary-green), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,230,118,0.2);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.stat-card-info h3 {
  color: var(--text-secondary, #94A3B8);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.stat-card-info .value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.text-green-500  { color: var(--primary-green); }
.text-yellow-500 { color: var(--accent-yellow); }
.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color-app);
}

/* ─────────── AUTH LAYOUT ─────────── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: radial-gradient(ellipse at top left, #111827 0%, #0B0F19 100%);
}
.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 2.5rem;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { color: var(--primary-green); font-size: 1.8rem; margin-bottom: 0.5rem; }

/* ─────────── MENU TOGGLE (Mobile) ─────────── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: var(--transition);
}
.menu-toggle:hover { background: rgba(255,255,255,0.05); }

/* ─────────── TOAST NOTIFICATIONS ─────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color-app);
  animation: slideInRight 0.35s ease forwards;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 400px;
  font-size: 0.9rem;
}
.toast.success { border-left: 3px solid var(--primary-green); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--brand-secondary, #2979FF); }

/* ─────────── ANIMATIONS ─────────── */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
@keyframes fadeInUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.fade-in-up { animation: fadeInUp 0.4s ease forwards; }

/* ─────────── THEME TOGGLE (fixed widget) ─────────── */
.theme-toggle-wrapper {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
}
.theme-toggle-btn {
  background: var(--bg-secondary, #111827);
  border: 1px solid var(--border-color-app);
  color: var(--text-main);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  font-size: 1.1rem;
}
.theme-toggle-btn:hover { transform: scale(1.12); box-shadow: var(--shadow-lg); }

/* ─────────── SURVEY CARDS (GeoSurveys) ─────────── */
.survey-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--border-color-app);
  backdrop-filter: var(--glass-blur);
  transition: var(--transition);
}
.survey-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,230,118,0.3);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

/* ─────────── CHIP TAGS ─────────── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color-app);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary, #94A3B8);
}
.chip input[type="checkbox"] { display: none; }
.chip:hover { background: rgba(0,230,118,0.08); border-color: var(--primary-green); color: var(--primary-green); }

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
  .top-header {
    padding: 0.6rem 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height, 64px);
    gap: 0.5rem;
  }
  .top-header h2 {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  .user-widget {
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .user-balance {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
  }
  /* notif-dropdown: posicionado via JS em mobile */
  .page-content {
    padding: 1.25rem 1rem;
  }
  .menu-toggle {
    display: flex !important;
  }
}
