/* =============================================================
   AJUSTENEROPLA - MASTER UNIFIED DESIGN SYSTEM
   Arquivo Único: css/style.css
   Contém: Layout, Sidebar, Painéis, Tabelas, Login, Gerador TMDB, Adverts Manual
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-emerald: #057d54;
  --emerald-glow: #10b981;
  --emerald-light: #34d399;
  --dark-bg: #07070c;
  --dark-surface: #0f0f18;
  --dark-card: #131320;
  --dark-card-hover: #181829;
  --dark-border: rgba(5, 125, 84, 0.25);
  --dark-border-hover: rgba(16, 185, 129, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background-color: var(--dark-bg) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  overflow-x: hidden;
}

.font-montserrat { font-family: 'Montserrat', sans-serif !important; }
.font-jakarta { font-family: 'Plus Jakarta Sans', sans-serif !important; }

/* Background Particles Container */
#js-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* =============================================================
   1. LOGIN PAGE STYLES (INDEX.PHP)
   ============================================================= */
body.netflix-login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: radial-gradient(circle at center, #0f172a 0%, #06070a 100%) !important;
  color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.netflix-login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.netflix-login-card {
  background: rgba(15, 15, 24, 0.85) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(5, 125, 84, 0.35) !important;
  border-radius: 20px !important;
  padding: 40px 32px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(5, 125, 84, 0.2) !important;
  transition: all 0.3s ease;
}

.netflix-login-card:hover {
  border-color: var(--emerald-glow) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 45px rgba(16, 185, 129, 0.3) !important;
}

.logo-container {
  text-align: center;
  margin-bottom: 24px;
}

.logo-container img {
  max-width: 130px;
  height: auto;
  filter: drop-shadow(0 4px 15px rgba(5, 125, 84, 0.4));
}

.netflix-login-card h2 {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 900 !important;
  font-size: 24px !important;
  letter-spacing: 1.5px !important;
  color: #fff !important;
  margin-bottom: 28px !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.netflix-login-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.netflix-login-footer a {
  color: var(--emerald-glow) !important;
  text-decoration: none !important;
  font-weight: 700;
  transition: color 0.2s ease;
}

.netflix-login-footer a:hover {
  color: #34d399 !important;
  text-decoration: underline !important;
}

/* =============================================================
   2. APP LAYOUT & SIDEBAR
   ============================================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  background: transparent;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 18px;
  background: rgba(10, 10, 16, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--dark-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(5, 125, 84, 0.1);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-emerald) 0%, var(--emerald-glow) 100%);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(5, 125, 84, 0.5);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text span:first-child {
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.logo-text span:last-child {
  color: var(--emerald-glow);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.nav-item .icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(5, 125, 84, 0.12);
  border-color: rgba(5, 125, 84, 0.3);
  transform: translateX(4px);
}

.nav-item:hover .icon {
  color: var(--emerald-glow);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(5, 125, 84, 0.4) 0%, rgba(16, 185, 129, 0.15) 100%);
  border-color: var(--emerald-glow);
  box-shadow: 0 4px 20px rgba(5, 125, 84, 0.25);
}

.nav-item.active .icon {
  color: var(--emerald-glow);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

.sidebar-foot {
  padding-top: 16px;
  border-top: 1px solid var(--dark-border);
  font-size: 11px;
  color: #64748b;
  text-align: center;
  line-height: 1.6;
}

.sidebar-foot a {
  color: var(--emerald-glow);
  text-decoration: none;
  font-weight: 700;
}

/* =============================================================
   3. TOPBAR & HEADERS
   ============================================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(10, 10, 16, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--dark-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar h2 {
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: uppercase;
}

#menu-toggle {
  background: #090910;
  border: 1px solid var(--dark-border);
  color: var(--emerald-glow);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 15px;
  cursor: pointer;
  display: none;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-glow);
  box-shadow: 0 0 10px var(--emerald-glow);
  display: inline-block;
}

.user-email {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: #090910;
  border: 1px solid var(--dark-border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
}

.btn-logout {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.content {
  padding: 28px 24px;
  flex: 1;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head h3 {
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.5px;
  margin: 0;
}

.page-head .sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 4px 0 0 0;
}

/* =============================================================
   4. PANELS, CARDS & CONTAINERS
   ============================================================= */
.panel, .card, .smarters-card {
  background: var(--dark-card) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover, .card:hover, .smarters-card:hover {
  border-color: var(--dark-border-hover) !important;
}

.panel-header, .card-header, .smarters-header {
  background: rgba(18, 18, 28, 0.95) !important;
  border-bottom: 1px solid var(--dark-border) !important;
  padding: 16px 22px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title, .card-title, .smarters-header-title {
  color: #fff !important;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800 !important;
  font-size: 15px !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title i, .card-title i, .smarters-header-title i {
  color: var(--emerald-glow);
}

.panel-body, .card-body {
  padding: 22px !important;
  color: var(--text-main) !important;
}

.panel-body.flush {
  padding: 0 !important;
}

/* Status Bar & Mode Badge */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
}

.status-bar .info h5 {
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-bar .info h5 i {
  color: var(--emerald-glow);
}

.status-bar .info p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.status-bar .ctrl {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.mode-badge.on {
  background: rgba(5, 125, 84, 0.2);
  border: 1px solid var(--emerald-glow);
  color: #4ade80;
}

.mode-badge.on .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
}

.mode-badge.off {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.mode-badge.off .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 10px #f87171;
}

/* =============================================================
   5. TABELAS, MINIATURAS E GRADES
   ============================================================= */
.premium-table, .table {
  width: 100%;
  color: var(--text-main) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 0 !important;
  background: transparent;
}

.premium-table thead th, .table thead th {
  border: none !important;
  background: rgba(14, 14, 22, 0.95) !important;
  color: var(--text-muted) !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

.premium-table tbody tr, .table tbody tr {
  background: transparent !important;
  transition: background 0.2s ease;
}

.premium-table tbody tr:hover, .table tbody tr:hover {
  background: rgba(5, 125, 84, 0.08) !important;
}

.premium-table tbody td, .table tbody td {
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 14px 20px !important;
  font-size: 13.5px !important;
  vertical-align: middle !important;
}

.premium-table td.num {
  font-weight: 800;
  color: var(--emerald-glow);
  font-size: 13px;
}

.premium-table td.strong {
  font-weight: 700;
  color: #fff;
}

.premium-table td.muted {
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Miniaturas da Tabela de Adverts (Corrigido: tamanho fixo controlado) */
.thumb, .thumb.poster, .poster, .preview-thumb {
  width: 72px !important;
  height: 56px !important;
  max-width: 72px !important;
  max-height: 56px !important;
  aspect-ratio: 5/4 !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  border: 1px solid var(--dark-border) !important;
  background: #000 !important;
  display: block !important;
}

/* Seção de Capas Enviadas ao APK (.cover-grid & .cover-card) */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.cover-card, .cover-card-preview {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(5, 125, 84, 0.45);
  background: #0c0c14;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  aspect-ratio: 5/4;
}

.cover-card:hover, .cover-card-preview:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 12px 28px rgba(5, 125, 84, 0.4);
}

.cover-card img, .cover-card-preview img {
  width: 100%;
  height: 100%;
  aspect-ratio: 5/4;
  object-fit: cover;
  display: block;
}

.cover-card .c-num {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #10b981;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(5, 125, 84, 0.5);
  z-index: 2;
}

.cover-card .c-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(12, 12, 20, 0.95) 0%, rgba(12, 12, 20, 0.7) 70%, transparent 100%);
  border-top: 1px solid rgba(5, 125, 84, 0.25);
}

.cover-card .c-title {
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats Pill & Empty State */
.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(5, 125, 84, 0.1);
  border: 1px solid var(--dark-border);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.stat-pill strong {
  color: var(--emerald-glow);
  font-weight: 800;
}

.stat-pill span {
  color: var(--text-muted);
}

.inline-loading {
  color: var(--emerald-glow);
  font-size: 13px;
  font-weight: 700;
  padding: 20px;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 32px;
  color: #232338;
  margin-bottom: 10px;
  display: block;
}

.empty-state p {
  margin: 0;
  font-size: 13.5px;
}

.cbx {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--emerald-glow);
}

/* =============================================================
   6. FORMULÁRIOS & BOTÕES
   ============================================================= */
.field {
  margin-bottom: 20px;
}

.field label {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 8px !important;
  display: block;
}

.input, .form-control {
  width: 100%;
  background: #090910 !important;
  border: 1.5px solid #232338 !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 16px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  outline: none;
  transition: all 0.25s ease !important;
}

.input:focus, .form-control:focus {
  border-color: var(--emerald-glow) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
  background: #0d0d16 !important;
}

.dropzone {
  position: relative;
  background: #090910;
  border: 2px dashed rgba(5, 125, 84, 0.4);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dropzone:hover {
  border-color: var(--emerald-glow);
  background: rgba(5, 125, 84, 0.05);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dz-icon {
  font-size: 28px;
  color: var(--emerald-glow);
}

.dz-text strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.dz-text small {
  color: var(--text-muted);
  font-size: 12px;
}

.preview-wrap {
  margin-top: 14px;
  display: none;
}

.preview-wrap img {
  max-width: 220px;
  max-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--emerald-glow);
  object-fit: cover;
}

/* Botões */
.btn-grad, .btn-smarters-grad, .btn-submit, .btn-primary {
  background: linear-gradient(135deg, var(--primary-emerald) 0%, var(--emerald-glow) 100%) !important;
  border: none !important;
  color: #fff !important;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800 !important;
  font-size: 13.5px !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 20px !important;
  box-shadow: 0 4px 18px rgba(5, 125, 84, 0.4) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
}

.btn-grad:hover, .btn-smarters-grad:hover, .btn-submit:hover, .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5) !important;
  filter: brightness(1.1);
  color: #fff !important;
}

.btn-soft {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-md) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-soft:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: #fff !important;
  color: #fff !important;
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-md) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
}

/* =============================================================
   7. MODALS & ALERTS
   ============================================================= */
.pmodal-content {
  background: var(--dark-card) !important;
  border: 1px solid var(--dark-border) !important;
  border-radius: var(--radius-lg) !important;
  color: #fff !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8) !important;
}

.pmodal-header {
  border-bottom: 1px solid var(--dark-border) !important;
  padding: 16px 20px !important;
}

.pmodal-header h4 {
  font-size: 16px !important;
  font-weight: 800 !important;
  margin: 0 !important;
  color: #f87171 !important;
}

.pmodal-body {
  padding: 20px !important;
  color: var(--text-muted) !important;
  font-size: 14px !important;
}

.pmodal-footer {
  border-top: 1px solid var(--dark-border) !important;
  padding: 14px 20px !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.alert-success {
  background: rgba(5, 125, 84, 0.15) !important;
  border: 1px solid var(--emerald-glow) !important;
  color: #4ade80 !important;
  border-radius: var(--radius-md) !important;
  font-weight: 700;
}

.alert-danger {
  background: rgba(220, 38, 38, 0.15) !important;
  border: 1px solid #ef4444 !important;
  color: #f87171 !important;
  border-radius: var(--radius-md) !important;
  font-weight: 700;
}

/* =============================================================
   8. FOOTER & RESPONSIVIDADE
   ============================================================= */
.footer {
  text-align: center;
  padding: 24px 0;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid var(--dark-border);
  margin-top: 30px;
}

.footer p { margin: 0; }
.footer strong { color: var(--emerald-glow); }

@media (max-width: 992px) {
  #menu-toggle { display: inline-block; }
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content {
    padding: 16px;
  }
}
