/* ============================================================
   YouTube Clipper - Global Styles
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;
  --dark: #111827;
  --gray: #6b7280;
  --light-bg: #f9fafb;
  --border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --card-shadow-hover: 0 10px 25px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--light-bg);
  color: var(--dark);
  min-height: 100vh;
}

/* ---- Navbar ---- */
.app-navbar {
  background: var(--dark);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.navbar-brand span { color: #2563eb; }

.nav-spacer { flex: 1; }

.nav-link-item {
  color: #9ca3af !important;
  text-decoration: none;
  font-size: .9rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all .2s;
  white-space: nowrap;
}

.nav-link-item:hover,
.nav-link-item.active {
  color: #fff !important;
  background: rgba(255,255,255,.08);
}

.nav-badge {
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d1d5db;
  font-size: .85rem;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
}

.nav-plan-badge {
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}
.plan-free    { background:#374151; color:#9ca3af; }
.plan-basic   { background:#0e7490; color:#cffafe; }
.plan-pro     { background:#1e40af; color:#bfdbfe; }
.plan-unlimited{ background:#065f46; color:#a7f3d0; }

.btn-logout {
  background: rgba(220,38,38,.15);
  color: #fca5a5 !important;
  border: 1px solid rgba(220,38,38,.3);
  text-decoration: none;
  font-size: .85rem;
  padding: 5px 12px;
  border-radius: 6px;
  transition: all .2s;
  cursor: pointer;
}
.btn-logout:hover { background: rgba(220,38,38,.3); color: #fff !important; }

/* ---- Cards ---- */
.card-clean {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-clean:hover { box-shadow: var(--card-shadow-hover); transition: box-shadow .2s; }

.card-header-clean {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body-clean { padding: 20px; }

/* ---- Stat Cards ---- */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: #dcfce7; }
.stat-icon.orange { background: #ffedd5; }
.stat-icon.purple { background: #f3e8ff; }
.stat-icon.red    { background: #fee2e2; }
.stat-icon.teal   { background: #ccfbf1; }

.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--gray); margin-top: 2px; }

/* ---- Buttons ---- */
.btn-primary-clean {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary-clean:hover { background: var(--primary-dark); color:#fff; }

.btn-success-clean {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-success-clean:hover { background: #15803d; color:#fff; }

.btn-outline-clean {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 9px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-outline-clean:hover { background: var(--primary); color: #fff; }

/* ---- Alerts ---- */
.alert-clean {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success-clean { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger-clean  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-info-clean    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-warning-clean { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ---- Forms ---- */
.form-group-clean { margin-bottom: 16px; }
.form-label-clean { font-size: .85rem; font-weight: 500; color: var(--dark); margin-bottom: 6px; display: block; }

.form-control-clean {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  background: #fff;
}
.form-control-clean:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-select-clean {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  outline: none;
  background: #fff;
  cursor: pointer;
}
.form-select-clean:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ---- Tables ---- */
.table-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table-clean th {
  background: #f3f4f6;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray);
  border-bottom: 1px solid var(--border);
}
.table-clean td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.table-clean tr:last-child td { border-bottom: none; }
.table-clean tr:hover td { background: #f9fafb; }

/* ---- Badges ---- */
.badge-clean {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-danger   { background: #fee2e2; color: #dc2626; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-gray     { background: #f3f4f6; color: #374151; }
.badge-purple   { background: #ede9fe; color: #6d28d9; }

/* ---- Progress Bar ---- */
.progress-clean {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width .3s;
}
.progress-fill.danger  { background: var(--danger); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.success { background: var(--success); }

/* ---- Auth Layout ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #020617, #1e1b4b, #172554, #1e3a8a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  padding: 24px;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.auth-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
  margin: 0;
}

.auth-logo p { color: var(--gray); font-size: .9rem; margin-top: 4px; }

/* ---- Plan Cards ---- */
.plan-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: all .2s;
  background: #fff;
  position: relative;
}
.plan-card:hover { border-color: var(--primary); box-shadow: var(--card-shadow-hover); }
.plan-card.current { border-color: var(--success); }
.plan-card.popular { border-color: var(--primary); }

.plan-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.plan-name { font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--gray); letter-spacing: .08em; }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--dark); margin: 8px 0; line-height: 1; }
.plan-price sup { font-size: 1rem; vertical-align: super; }
.plan-period { font-size: .8rem; color: var(--gray); }
.plan-feature { font-size: .85rem; color: var(--dark); margin: 6px 0; }

/* ---- Dashboard Charts ---- */
.chart-wrap { position: relative; height: 280px; }

/* ---- Misc ---- */
.page-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.page-title { font-size: 1.4rem; font-weight: 700; color: var(--dark); margin: 0; }
.page-subtitle { font-size: .875rem; color: var(--gray); margin-top: 4px; }

.container-page { max-width: 1200px; margin: 0 auto; padding: 24px; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h5 { color: var(--dark); }

/* ── Danger button ─────────────────────────────────────────────────────────── */
.btn-danger-clean {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.btn-danger-clean:hover { background: #b91c1c; color: #fff; }

/* ── alert-warning-clean (para Whisper não instalado) ──────────────────────── */
.alert-warning-clean {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #fefce8;
    border: 1.5px solid #fde047;
    border-radius: 10px;
    font-size: .875rem;
    margin-bottom: 16px;
    color: #713f12;
}

/* ── filter-btn active ─────────────────────────────────────────────────────── */
.filter-active {
    background: #f3f4f6 !important;
    font-weight: 700 !important;
}

/* ── Mobile Responsive Header ─────────────────────────────────────────────── */
/* ── Mobile Responsive Header (Offcanvas) ─────────────────────────────────── */
@media (max-width: 768px) {
  .app-navbar {
    padding: 0 16px;
    height: 60px;
    justify-content: space-between;
  }
  
  .navbar-brand {
      font-size: 1.1rem;
  }
}

/* Offcanvas Menu Styles */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.mobile-nav-link:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.mobile-nav-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.mobile-nav-link svg {
    color: #6b7280;
}

.mobile-nav-link.active svg {
    color: #2563eb;
}

/* ---- Clips Page Responsive ---- */
.clip-row {
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.1s;
}

.clip-row:hover {
    background: #f9fafb;
}

@media (max-width: 768px) {
    .clip-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        position: relative;
    }

    /* Icon in row */
    .clip-row > div:first-child {
        position: absolute;
        top: 14px;
        left: 14px;
    }

    /* Main info content */
    .clip-row > div:nth-child(2) {
        margin-left: 48px; /* space for icon */
        margin-bottom: 8px;
    }

    /* Actions container */
    .clip-row > div:last-child {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between;
        width: 100%;
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px solid #f3f4f6;
    }
    
    /* Status badge inside actions */
    .clip-row > div:last-child > span:first-child {
        order: -1; 
    }
}
