:root {
  --background: #0b0f19;
  --foreground: #f1f5f9;
  --card-bg: rgba(20, 27, 45, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --secondary: #1e293b;
  --accent: #a855f7; /* Purple */
  --success: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  --danger: #ef4444; /* Rose */
  --muted: #94a3b8;
  --cyan: #06b6d4; /* Cyan */
  --font-sans: var(--font-geist-sans), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: var(--font-geist-mono), monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Background animated glow spots */
body::before {
  content: "";
  position: fixed;
  top: -10%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

body::after {
  content: "";
  position: fixed;
  bottom: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

/* Accent color for standard HTML form elements */
body {
  accent-color: var(--primary);
}

/* Glassmorphism card utility */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px) saturate(120%);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Custom premium buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
  opacity: 0.95;
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--foreground);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: #273549;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  opacity: 0.9;
}

/* Forms styling */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(15, 22, 40, 0.8);
  border: 1px solid var(--card-border);
  color: var(--foreground);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Badge styling */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-suspended {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Tables styling */
/* Prevent CSS Grid/Flex items from breaking scroll containers */
.glass-card, .grid > div, .tab-section, main {
  min-width: 0;
  max-width: 100%;
}

/* Table Container & Horizontal Scroll Support for Mobile & Desktop */
.table-container {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(15, 22, 40, 0.4);
  position: relative;
}

/* Styled Scrollbars for Mobile & Desktop Touch Scrolling */
.table-container::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(15, 22, 40, 0.8);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 4px;
  border: 2px solid rgba(15, 22, 40, 0.8);
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  min-width: 720px; /* Garante que a tabela mantenha proporções e ative a rolagem horizontal no mobile */
}

.table th {
  padding: 14px 16px;
  background: rgba(20, 27, 45, 0.8);
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  color: var(--foreground);
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Mobile Adjustments for Tables */
@media (max-width: 768px) {
  .table {
    min-width: 680px; /* Largura mínima para garantir rolagem horizontal limpa em smartphones */
    font-size: 13px;
  }
  
  .table th, .table td {
    padding: 12px 14px;
  }
}

/* Typography elements */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 24px;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Custom Header Gradient Span */
h1 span {
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Center alignment rules for Bama Banners */
.bama-ad-zone, .bama-wp-ad {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

.bama-ad-zone img, .bama-wp-ad img {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
