/* PDM Biblioteca Digital - Estilos principales */

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

/* ─── Base ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; }
.font-inter { font-family: 'Inter', sans-serif; }

/* ─── Scrollbar personalizada ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4B5563; }

/* ─── Utilidades ─────────────────────────────────────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prose-invert p { color: #9ca3af; }
.prose-invert h2, .prose-invert h3 { color: #f3f4f6; }

/* ─── Animaciones ────────────────────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}

/* ─── Cards de libros ────────────────────────────────────────────────────────── */
.book-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.book-card:hover {
    transform: translateY(-4px);
}

/* ─── Skeleton loader ────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Formularios ────────────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* ─── Botones ────────────────────────────────────────────────────────────────── */
button, a {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

/* ─── Overlay de búsqueda ────────────────────────────────────────────────────── */
#search-results {
    max-height: 400px;
    overflow-y: auto;
}

/* ─── Stats cards ────────────────────────────────────────────────────────────── */
.stat-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
    border: 1px solid rgba(99,102,241,0.2);
}

/* ─── Admin table ────────────────────────────────────────────────────────────── */
.admin-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.75rem 1rem;
}
.admin-table td {
    padding: 0.875rem 1rem;
    border-top: 1px solid #1f2937;
    font-size: 0.875rem;
}
.admin-table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}

/* ─── Badge de estado ────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; }
.badge-active   { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-expired  { background: rgba(239,68,68,0.15);  color: #f87171;  border: 1px solid rgba(239,68,68,0.3); }
.badge-pending  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-suspended{ background: rgba(156,163,175,0.15);color: #9ca3af; border: 1px solid rgba(156,163,175,0.3); }
.badge-draft    { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }

/* ─── Responsive fixes ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 0.5rem 0.75rem; }
}

/* ─── Print protection ───────────────────────────────────────────────────────── */
@media print {
    body { display: none !important; }
}
