/* ============================================================
   Bíblia Explicada — style.css
   Fonte: Inter | Cores: Azul #1E3A8A, Branco, Cinza Chumbo
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900:  #1E3A8A;
  --blue-800:  #1E40AF;
  --blue-700:  #1D4ED8;
  --blue-600:  #2563EB;
  --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: 260px;
  --header-h:  64px;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 24px rgba(30,58,138,.12);
  --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;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ================================================================
   LAYOUT PRINCIPAL
   ================================================================ */
.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: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--blue-600);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-logo .logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.55);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 8px 8px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: var(--white);
}

.nav-item.active {
  background: var(--blue-600);
  color: var(--white);
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 12px;
  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,.07);
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--blue-600);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .user-name {
  font-size: 13px; font-weight: 600;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info .user-role {
  font-size: 11px; color: rgba(255,255,255,.5);
}

.btn-logout {
  background: none; border: none;
  color: rgba(255,255,255,.5);
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition);
}
.btn-logout:hover { color: #FCA5A5; }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Header ── */
.top-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
}

.header-title h1 {
  font-size: 18px;
  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: 10px; }

/* Hamburger (mobile) */
.btn-menu {
  display: none;
  background: none; border: none;
  font-size: 20px; color: var(--gray-700);
  padding: 6px;
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: 28px;
  max-width: 1100px;
  width: 100%;
}

/* ================================================================
   COMPONENTES
   ================================================================ */

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--gray-100);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  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-info .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.stat-info .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  line-height: 1;
}

.btn-primary {
  background: var(--blue-700);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-800); box-shadow: var(--shadow-md); }

.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: var(--white);
}
.btn-danger:hover { background: #DC2626; }

.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: 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: 24px;
}
.search-bar .form-control { flex: 1; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}
.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; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-300);
}
tbody td {
  padding: 13px 14px;
  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: 10px;
}
.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 Display */
.verse-box {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.verse-box::before {
  content: '\201C';
  position: absolute;
  top: -10px; left: 16px;
  font-size: 120px;
  font-weight: 800;
  color: rgba(255,255,255,.08);
  line-height: 1;
  font-family: Georgia, serif;
}
.verse-ref {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 12px;
}
.verse-text {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--white);
}

/* Explanation Box */
.explanation-box {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.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.8;
  color: var(--gray-700);
}

/* Loading spinner */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: rgba(37,99,235,.2);
  border-top-color: var(--blue-700);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* Overlay sidebar (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.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: 40px;
  background: linear-gradient(160deg, var(--blue-900) 0%, #0F2060 100%);
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '✝';
  position: absolute;
  bottom: -30px; right: -20px;
  font-size: 260px;
  color: rgba(255,255,255,.04);
}

.login-brand { text-align: center; color: var(--white); }
.login-brand .brand-icon {
  width: 64px; height: 64px;
  background: var(--blue-600);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
}
.login-brand h1 { font-size: 28px; font-weight: 800; }
.login-brand p  { font-size: 14px; color: rgba(255,255,255,.6); margin-top: 6px; }

.login-tagline {
  margin-top: 48px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  max-width: 320px;
}

.login-right {
  width: 440px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form-box { width: 100%; max-width: 360px; }
.login-form-box h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.login-form-box > p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.login-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}
.login-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--gray-300);
}
.login-divider span {
  position: relative;
  background: var(--white);
  padding: 0 12px;
  font-size: 12px;
  color: var(--gray-500);
}

.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,.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(.95) translateY(10px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  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-500);
  padding: 4px; line-height: 1;
}
.btn-close:hover { color: var(--gray-900); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ================================================================
   RESPONSIVO
   ================================================================ */
@media (max-width: 1024px) {
  .page-content { padding: 20px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }
  .btn-menu { display: flex; }

  .top-header { padding: 0 16px; }
  .page-content { padding: 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .login-left { display: none; }
  .login-right { width: 100%; }

  .verse-text { font-size: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .modal { margin: 0; border-radius: var(--radius) var(--radius) 0 0; }
}