/* Sistema Web + Multimedia - Estilos (responsive, alto contraste) */
:root {
    --bg: #f5f6fa;
    --surface: #fff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #059669;
    --error: #dc2626;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    background: var(--surface);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.main-header h1 { margin: 0; font-size: 1.25rem; }
.main-header h1 a { color: var(--text); text-decoration: none; }
.main-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.main-nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
}
.main-nav a:hover { background: var(--bg); color: var(--primary-dark); }
.nav-logout { color: var(--secondary) !important; }

/* Main */
main.container { flex: 1; padding: 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.container-narrow { max-width: 420px; }
.hero { text-align: center; padding: 2rem 1rem; }
.hero h1 { margin-bottom: 0.5rem; }
.lead { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.card-link {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    padding: 1.5rem;
    transition: box-shadow .2s, transform .2s;
}
.card-link:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-link.btn-primary { background: var(--primary); color: #fff; }
.card-link.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* Course cards */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.curso-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow .2s;
}
.curso-card:hover { box-shadow: var(--shadow-lg); }
.curso-card-img {
    height: 160px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}
.curso-card-img img { width: 100%; height: 100%; object-fit: cover; }
.curso-card-body { padding: 1rem; }
.curso-card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.curso-card .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.curso-card .btn { margin-top: 0.5rem; }

/* Forms */
.form-card label { display: block; margin-bottom: 0.75rem; font-weight: 500; }
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="number"],
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-top: 0.25rem;
}
.form-card textarea { min-height: 100px; resize: vertical; }
.form-error { color: var(--error); font-size: 0.85rem; display: block; margin-top: 0.25rem; }

/* Login */
.login-page .main-header { margin-bottom: 0; }
.login-card { margin-top: 2rem; }
.login-card h2 { margin-top: 0; margin-bottom: 1rem; }
.login-card label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.login-card input { width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.25rem; }
.login-footer { margin-top: 1rem; text-align: center; }
.login-footer a { color: var(--primary); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #475569; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.9rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* Dashboard */
.dashboard-layout { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.dashboard-sidebar {
    flex: 0 0 220px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    height: fit-content;
}
.dashboard-sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; }
.dashboard-sidebar a { padding: 0.5rem 0.75rem; border-radius: var(--radius); text-decoration: none; color: var(--text); }
.dashboard-sidebar a:hover { background: var(--bg); color: var(--primary); }
.dashboard-main { flex: 1; min-width: 0; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dashboard-cards .card { margin-bottom: 0; }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a {
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius) var(--radius) 0 0;
}
.tabs a:hover { color: var(--primary); }
.tabs a.active { color: var(--primary); font-weight: 600; background: var(--bg); }

/* Multimedia */
.media-player { max-width: 100%; margin: 1rem 0; border-radius: var(--radius); background: #000; }
.media-player video, .media-player audio { width: 100%; }
.contenido-lista { list-style: none; padding: 0; margin: 0; }
.contenido-lista li { padding: 0.75rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.contenido-lista li:last-child { border-bottom: none; }

/* Evaluación */
.pregunta-block { margin-bottom: 1.5rem; padding: 1rem; background: var(--surface); border-radius: var(--radius); }
.pregunta-block label { display: block; margin: 0.5rem 0; cursor: pointer; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.results-table th { background: var(--bg); font-weight: 600; }

/* Search */
.search-bar { margin-bottom: 1rem; }
.search-bar input { width: 100%; max-width: 400px; padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); }

/* Footer */
.site-footer { padding: 1rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; background: var(--surface); margin-top: auto; }

/* Utility */
.text-center { text-align: center; }

/* Responsive */
@media (max-width: 768px) {
    .main-header { flex-direction: column; align-items: stretch; }
    .main-nav { justify-content: flex-start; }
    .dashboard-sidebar { flex: 1 1 100%; }
    .cursos-grid { grid-template-columns: 1fr; }
    .curso-card-img { height: 140px; }
}

@media (max-width: 480px) {
    main.container { padding: 1rem; }
    .card { padding: 1rem; }
}
