/* ============================================================
   CursosAvila — Base Styles (Reset, Typography, Layout)
   ============================================================ */

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

h1 { font-size: var(--text-3xl); font-weight: var(--font-bold); }
h2 { font-size: var(--text-2xl); font-weight: var(--font-semibold); }
h3 { font-size: var(--text-xl); font-weight: var(--font-semibold); }
h4 { font-size: var(--text-lg); font-weight: var(--font-semibold); }

p { color: var(--text-secondary); line-height: var(--leading-relaxed); }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-light); }
ul, ol { list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; user-select: none; }
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
table { width: 100%; border-collapse: collapse; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: var(--radius-full); }
::selection { background: var(--primary-alpha); color: var(--text-primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left var(--transition-base); }
.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }
.page-content { flex: 1; padding: var(--space-8); max-width: var(--content-max-width); width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-8); gap: var(--space-4); flex-wrap: wrap; }
.page-header-left { display: flex; flex-direction: column; gap: var(--space-1); }
.page-title { font-size: var(--text-2xl); font-weight: var(--font-bold); display: flex; align-items: center; gap: var(--space-3); }
.page-subtitle { font-size: var(--text-sm); color: var(--text-secondary); }
.page-actions { display: flex; align-items: center; gap: var(--space-3); }

/* Utilities */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-mono { font-family: var(--font-mono); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }

/* Animations */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-1%, 2%); }
}

.skeleton { background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.fade-in-up { animation: fadeInUp 0.5s ease forwards; }
