/*
 * main.css — Estilos globais do projeto Devocional e Discipulado
 *
 * Convenções:
 *  - Usar variáveis CSS para cores e espaçamentos
 *  - Mobile-first (Bootstrap 5 já cobre responsividade base)
 *  - Evitar !important
 */

/* ── Variáveis ──────────────────────────────────────────────────────────── */
:root {
    --cor-primaria: #0d6efd;
    --cor-texto-muted: #6c757d;
}

/* ── Body ───────────────────────────────────────────────────────────────── */
html {
    /* Evita fundo branco no overscroll/rubber-band em mobile */
    background-color: var(--bs-body-bg);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bs-body-bg);
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar-brand {
    font-size: 1.1rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
    border-radius: 0.5rem;
}

/* ── Variáveis de tema ──────────────────────────────────────────────────── */
:root {
    --color-primary: #0d6efd;
    --color-success: #198754;
    --color-warning: #ffc107;
    --color-danger:  #dc3545;
    --color-info:    #0dcaf0;
    --color-muted:   #6c757d;
    --transition-theme: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ── Transição suave ao trocar dark/light mode ──────────────────────────── */
html,
body,
.navbar,
.card,
footer {
    transition: var(--transition-theme);
}

/* ── Page Loader (overlay de carregamento) ──────────────────────────────── */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-body-bg, #fff);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Card com hover sutil ────────────────────────────────────────────────── */
.card-hover {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.card-hover:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ── Badges de status ────────────────────────────────────────────────────── */
.badge-status {
    display: inline-block;
    font-size: 0.75em;
    padding: 0.35em 0.7em;
    border-radius: 50rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-status.ativo {
    background-color: #d1e7dd;
    color: #0a3622;
}

.badge-status.inativo {
    background-color: #f8d7da;
    color: #58151c;
}

.badge-status.pendente {
    background-color: #fff3cd;
    color: #664d03;
}

[data-bs-theme="dark"] .badge-status.ativo {
    background-color: #0a3622;
    color: #a3cfbb;
}

[data-bs-theme="dark"] .badge-status.inativo {
    background-color: #58151c;
    color: #f1aeb5;
}

[data-bs-theme="dark"] .badge-status.pendente {
    background-color: #664d03;
    color: #ffda6a;
}

/* ── Avatar (imagem circular ou iniciais) ───────────────────────────────── */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--color-primary);
    color: #fff;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
}

.avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.4rem;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state .bi {
    opacity: 0.3;
}

/* ── Skeleton Loading ────────────────────────────────────────────────────── */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.skeleton {
    background-color: var(--bs-secondary-bg, #e9ecef);
    border-radius: 0.25rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    min-height: 1rem;
}

.skeleton-text {
    height: 0.9rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}
