/* ============================================================
   Bíblia Explicada — style.css — Mobile First
   Fonte: Inter | Azul e Branco
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --blue-900: #1E3A8A;
  --blue-800: #1E40AF;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-100: #DBEAFE;
  --blue-50:  #EFF6FF;
  --white:    #FFFFFF;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --sidebar-w: 280px;
  --header-h:  58px;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 4px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.05);
  --shadow-md: 0 4px 20px rgba(30,58,138,.13);
  --transition: .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

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

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--blue-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--blue-600);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.logo-text { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.logo-text span { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.45); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 14px 10px; }

.nav-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 10px 10px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: 15px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--blue-600); color: #fff; }
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.1); }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--blue-500); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); }

.btn-logout { background: none; border: none; color: rgba(255,255,255,.4); font-size: 18px; padding: 4px; }
.btn-logout:hover { color: #FCA5A5; }

/* ── Main ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

/* ── Header ── */
.top-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  gap: 12px;
}

.header-title h1 { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.header-title p  { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.header-actions  { display: flex; align-items: center; gap: 8px; }

.btn-menu {
  display: none; background: none; border: none;
  font-size: 22px; color: var(--gray-700);
  padding: 6px; border-radius: 8px;
  transition: background var(--transition);
}

.btn-menu:active { background: var(--gray-100); }

/* ── Page Content ── */
.page-content { flex: 1; padding: 20px; width: 100%; max-width: 1100px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--gray-100);
  margin-bottom: 16px;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 10px; flex-wrap: wrap;
}

.card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.stat-icon.blue  { background: var(--blue-50); }
.stat-icon.green { background: #F0FDF4; }
.stat-icon.amber { background: #FFFBEB; }

.stat-value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: none;
  transition: all var(--transition); line-height: 1; white-space: nowrap; cursor: pointer;
}

.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover  { background: var(--blue-800); }
.btn-primary:active { background: var(--blue-900); transform: scale(.98); }

.btn-outline { background: transparent; color: var(--blue-700); border: 1.5px solid var(--blue-700); }
.btn-outline:hover { background: var(--blue-50); }

.btn-ghost { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-danger { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; }

.btn-sm  { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg  { padding: 14px 24px; font-size: 16px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
}

.form-control {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit; color: var(--gray-900);
  background: var(--white); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-control:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Search Bar ── */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar .form-control { flex: 1; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}

.badge-blue  { background: var(--blue-100); color: var(--blue-800); }
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-gray  { background: var(--gray-100); color: var(--gray-700); }
.badge-amber { background: #FEF3C7; color: #92400E; }

/* ── Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 12px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody td { padding: 12px; font-size: 14px; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--blue-50); }

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
}
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-info    { background: var(--blue-50); color: var(--blue-800); border: 1px solid var(--blue-100); }

/* ── Verse Box ── */
.verse-box {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 24px 20px; position: relative; overflow: hidden; margin-bottom: 16px;
}

.verse-box::before {
  content: '\201C'; position: absolute; top: -20px; left: 10px;
  font-size: 100px; font-weight: 800; color: rgba(255,255,255,.07);
  line-height: 1; font-family: Georgia, serif;
}

.verse-ref { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 10px; }
.verse-text { font-size: 17px; font-weight: 400; line-height: 1.7; color: #fff; }

/* ── Explanation ── */
.explanation-box {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}

.explanation-box h3 { font-size: 15px; font-weight: 700; color: var(--blue-900); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.explanation-text { font-size: 15px; line-height: 1.85; color: var(--gray-700); }
.explanation-text p { margin-bottom: 14px; }
.explanation-text p:last-child { margin-bottom: 0; }

/* ── Spinner ── */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block; vertical-align: middle;
}
.spinner.dark { border-color: rgba(37,99,235,.2); border-top-color: var(--blue-600); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty-icon  { font-size: 44px; margin-bottom: 14px; opacity: .45; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; line-height: 1.6; }

/* ── Overlay ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 199;
}

/* ================================================================
   LOGIN
   ================================================================ */
.login-page { min-height: 100vh; display: flex; background: var(--blue-900); }

.login-left {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(160deg, var(--blue-900) 0%, #0F2060 100%);
  position: relative; overflow: hidden;
}

.login-left::before {
  content: '✝'; position: absolute; bottom: -40px; right: -20px;
  font-size: 280px; color: rgba(255,255,255,.04);
}

.login-brand { text-align: center; color: #fff; }

.brand-icon {
  width: 70px; height: 70px; background: var(--blue-600);
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.login-brand h1 { font-size: 30px; font-weight: 800; }
.login-brand p  { font-size: 14px; color: rgba(255,255,255,.55); margin-top: 6px; }
.login-tagline  { margin-top: 48px; color: rgba(255,255,255,.6); font-size: 14px; line-height: 1.8; text-align: center; max-width: 300px; font-style: italic; }

.login-right {
  width: 460px; background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 36px;
}

.login-form-box { width: 100%; max-width: 360px; }
.login-form-box h2 { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.login-form-box > p { font-size: 14px; color: var(--gray-500); margin-bottom: 28px; line-height: 1.5; }

.register-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--gray-500); }
.register-link a { color: var(--blue-700); font-weight: 600; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 300;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(12px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--gray-100); }
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.btn-close { background: none; border: none; font-size: 20px; color: var(--gray-400); padding: 4px; border-radius: 6px; cursor: pointer; }
.btn-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body   { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 8px; }

/* ================================================================
   RESPONSIVO MOBILE
   ================================================================ */
@media (max-width: 768px) {

  /* Sidebar off-canvas */
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 6px 0 30px rgba(0,0,0,.25); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .btn-menu { display: flex; }

  /* Header */
  .top-header { padding: 0 14px; height: 56px; }
  .header-title h1 { font-size: 16px; }
  .header-title p  { display: none; }
  .header-actions .btn { padding: 9px 14px; font-size: 13px; }

  /* Conteúdo */
  .page-content { padding: 12px; }

  /* Stats 2 colunas */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card  { padding: 14px 12px; gap: 10px; border-radius: var(--radius-sm); }
  .stat-icon  { width: 40px; height: 40px; font-size: 18px; border-radius: 8px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 11px; }

  /* Cards */
  .card { padding: 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
  .card-header { margin-bottom: 12px; }
  .card-title  { font-size: 14px; }

  /* Verse box */
  .verse-box  { padding: 18px 16px; border-radius: var(--radius-sm); }
  .verse-text { font-size: 16px; line-height: 1.65; }
  .verse-ref  { font-size: 10px; }

  /* Explanation */
  .explanation-box { padding: 14px; border-radius: var(--radius-sm); }
  .explanation-box h3 { font-size: 14px; }
  .explanation-text { font-size: 14px; line-height: 1.8; }

  /* Search bar em coluna */
  .search-bar { flex-direction: column; gap: 8px; }
  .search-bar .btn { width: 100%; padding: 14px; font-size: 15px; }

  /* Table */
  tbody td { font-size: 13px; padding: 10px; }

  /* Botões */
  .btn-lg { padding: 13px 20px; font-size: 15px; }
  .btn-sm { padding: 7px 12px; font-size: 12px; }

  /* Alert */
  .alert { font-size: 13px; }

  /* Login */
  .login-left  { display: none; }
  .login-right { width: 100%; padding: 32px 20px; }
  .login-form-box h2 { font-size: 22px; }

  /* Modal sobe do fundo */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 88vh; animation: slideUp .25s ease; }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  /* Empty state menor */
  .empty-state { padding: 28px 16px; }
  .empty-icon  { font-size: 36px; }
}

/* Telas muito pequenas */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 10px; }
  .verse-text { font-size: 15px; }
}

/* Desktop */
@media (min-width: 1200px) {
  .page-content { padding: 28px 32px; }
}
