/**
 * Edenware Shared Theme
 *
 * Design System compartilhado para todos os serviços Edenware.
 * Inclua com:
 *   <link rel="stylesheet" href="/edenware-theme.css">
 *
 * Ou importe no CSS principal:
 *   @import url('/edenware-theme.css');
 *
 * Cada addon pode sobrescrever as variáveis para personalizar.
 */

/* ══════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Theme Variables)
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Cores primárias — Edenware Brand */
  --ew-primary: #7C3AED;
  --ew-primary-hover: #6D28D9;
  --ew-primary-gradient: linear-gradient(45deg, #4b1484, #00126a 25%, #00126a 75%, #03646d);
  --ew-primary-light: #A5B4FC;
  --ew-primary-bg: rgba(124, 58, 237, 0.1);
  --ew-secondary: #14B8A6;
  --ew-secondary-hover: #0D9488;
  --ew-secondary-bg: rgba(20, 184, 166, 0.1);

  /* Cores de status */
  --ew-success: #14B8A6;
  --ew-success-bg: rgba(20, 184, 166, 0.12);
  --ew-warning: #F59E0B;
  --ew-warning-bg: rgba(245, 158, 11, 0.12);
  --ew-danger: #EF4444;
  --ew-danger-bg: rgba(239, 68, 68, 0.12);
  --ew-info: #7C3AED;
  --ew-info-bg: rgba(124, 58, 237, 0.12);

  /* Cores de superfície — Dark Blue */
  --ew-bg: #0F172A;
  --ew-surface: #1E1B4B;
  --ew-surface-2: #0F172A;
  --ew-border: #2D2A5A;
  --ew-border-light: #1a1740;

  /* Cores de texto */
  --ew-text: #E8E8E8;
  --ew-text-secondary: #94A3B8;
  --ew-text-muted: #64748B;

  /* Tipografia */
  --ew-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ew-font-mono: 'Monaco', 'Menlo', 'Consolas', monospace;

  /* Bordas */
  --ew-radius-sm: 6px;
  --ew-radius: 8px;
  --ew-radius-lg: 12px;

  /* Transições */
  --ew-transition: 0.15s ease;

  /* Nav shadow */
  --ew-nav-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ══════════════════════════════════════════════════════════════════
   LIGHT THEME
   ══════════════════════════════════════════════════════════════════ */

[data-theme="light"] {
  --ew-primary: #7C3AED;
  --ew-primary-hover: #6D28D9;
  --ew-primary-gradient: linear-gradient(45deg, #731dcc, #011b9a 25%, #001b9d 75%, #038f9c);
  --ew-primary-light: #6D28D9;
  --ew-primary-bg: rgba(124, 58, 237, 0.08);
  --ew-secondary: #0D9488;
  --ew-secondary-hover: #0F766E;
  --ew-secondary-bg: rgba(13, 148, 136, 0.08);

  --ew-bg: #F8FAFC;
  --ew-surface: #FFFFFF;
  --ew-surface-2: #F1F5F9;
  --ew-nav-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --ew-border: #E2E8F0;
  --ew-border-light: #CBD5E1;

  --ew-text: #0F172A;
  --ew-text-secondary: #475569;
  --ew-text-muted: #94A3B8;

  --ew-success-bg: rgba(20, 184, 166, 0.08);
  --ew-warning-bg: rgba(245, 158, 11, 0.08);
  --ew-danger-bg: rgba(239, 68, 68, 0.08);
  --ew-info-bg: rgba(124, 58, 237, 0.08);
}

/* ══════════════════════════════════════════════════════════════════
   RESET
   ══════════════════════════════════════════════════════════════════ */

.ew-reset, [class^="ew-"] {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ══════════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════════ */

.ew-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.ew-badge-active {
  background: var(--ew-success-bg);
  color: var(--ew-success);
}

.ew-badge-inactive {
  background: var(--ew-danger-bg);
  color: var(--ew-danger);
}

.ew-badge-premium {
  background: var(--ew-secondary-bg);
  color: var(--ew-secondary);
}

.ew-badge-free {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.ew-badge-info {
  background: var(--ew-info-bg);
  color: var(--ew-info);
}

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════ */

.ew-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--ew-radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--ew-transition);
  font-family: var(--ew-font);
}

.ew-btn-primary {
  background: var(--ew-primary-gradient, linear-gradient(45deg, #4b1484, #00126a 25%, #00126a 75%, #03646d));
  color: #fff;
}

.ew-btn-primary:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px rgba(75, 20, 132, 0.4);
  transform: translateY(-1px);
}

.ew-btn-secondary {
  background: var(--ew-secondary);
  color: #fff;
}

.ew-btn-secondary:hover {
  background: var(--ew-secondary-hover);
}

.ew-btn-outline {
  background: transparent;
  color: var(--ew-primary);
  border: 1px solid var(--ew-primary);
}

.ew-btn-outline:hover {
  background: var(--ew-primary-bg);
}

.ew-btn-danger {
  background: var(--ew-danger);
  color: #fff;
}

.ew-btn-danger:hover {
  background: #c0392b;
}

.ew-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════ */

.ew-card {
  background: var(--ew-surface);
  border-radius: var(--ew-radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--ew-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ew-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ══════════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════════ */

.ew-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--ew-radius);
  border: 1px solid var(--ew-border);
  background: var(--ew-bg);
  color: var(--ew-text);
  font-size: 0.95rem;
  font-family: var(--ew-font);
  transition: border-color var(--ew-transition);
}

.ew-input:focus {
  outline: none;
  border-color: var(--ew-primary);
}

.ew-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ew-label {
  display: block;
  color: var(--ew-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════ */

.ew-table {
  width: 100%;
  border-collapse: collapse;
}

.ew-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--ew-text-secondary);
  font-weight: 600;
  border-bottom: 2px solid var(--ew-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ew-table td {
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--ew-text);
  border-bottom: 1px solid var(--ew-border-light);
}

.ew-table tr:last-child td {
  border-bottom: none;
}

.ew-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ══════════════════════════════════════════════════════════════════
   GRID & LAYOUT
   ══════════════════════════════════════════════════════════════════ */

.ew-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.ew-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ew-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ══════════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════════ */

.ew-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.ew-page-info {
  font-size: 0.9rem;
  color: var(--ew-text-secondary);
  padding: 0 12px;
}

/* ══════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════════════════════════ */

.ew-progress {
  height: 8px;
  background: var(--ew-border);
  border-radius: 4px;
  overflow: hidden;
}

.ew-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE UTILITIES
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ew-hide-mobile {
    display: none !important;
  }
  .ew-grid-2,
  .ew-grid-3,
  .ew-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════════ */

@keyframes ew-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ew-fade-in {
  animation: ew-fadeIn 0.3s ease forwards;
}
