/* Reset básico y variables */
:root {
    --primary: #4A6CF7;
    --primary-dark: #3a5be0;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #e9ecef;
    --border: #dee2e6;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

/* Login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    margin-bottom: 1rem;
}

.login-header h1 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--secondary);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Layout principal */
.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    background-color: var(--secondary);
    color: white;
    padding: 1.5rem 0;
    position: fixed;
    top: 70px; /* Ajusta según la altura de tu header */
    left: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 900;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 250px; /* espacio para el sidebar */
}

/* Header */
.header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 1000;
}

.header .brand {
    display: flex;
    align-items: center;
}

.header .brand img {
    margin-right: 10px;
}

.header .user-menu {
    display: flex;
    align-items: center;
}

.header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Sidebar */


.sidebar-menu li {
    margin-bottom: 0.5rem;
}
/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--secondary);
    color: white;
    padding: 1.5rem 0;
    position: fixed;
    top: 80px; /* Ajuste: empezar un poco más abajo del header */
    left: 0;
    height: calc(100vh - 80px); /* Ajustar altura */
    overflow-y: auto;
    z-index: 900;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 1.5rem 1.5rem; /* Espacio arriba para los enlaces */
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 250px;
    margin-top: 70px; /* Evitar que el contenido quede tapado por el header */
    min-height: calc(100vh - 70px);
}
.sidebar-menu a {
    display: block;
    padding: 0.85rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    border-radius: 6px;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Tarjetas */
.course-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.course-info {
    padding: 1.5rem;
}

.course-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.course-info p {
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* Grid de cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Estadísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--secondary);
}

/* Formularios */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-title {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Tablas */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray);
}

.data-table th {
    background-color: var(--gray);
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f9f9f9;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        margin-top: 70px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
}

/* Estilos para la página de perfil */
.profile-container {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.profile-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.profile-content {
    flex: 1;
}

.avatar-container {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--light);
}

.profile-avatar-initials {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    margin: 0 auto 1rem auto;
    border: 4px solid var(--light);
}

.avatar-form {
    margin-top: 1rem;
}

.avatar-label {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--gray);
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}

.avatar-label:hover {
    background: #d6d8db;
}

.user-info {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.user-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.user-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0.5rem 0;
}

.user-since {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.video {
    background: #e8f4fd;
    color: #0a84ff;
}

.badge.diapositivas {
    background: #fde8f8;
    color: #ff2d55;
}

.badge.scratch {
    background: #ff9f00;
    color: white;
}

.badge.simulador {
    background: #6c5ce7;
    color: white;
}

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

/* Visualizador de contenido */
.content-viewer {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.viewer-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray);
}

/* Grid de contenido */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s;
}

.content-card:hover {
    transform: translateY(-5px);
}

.content-header {
    padding: 1rem;
    background: var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-body {
    padding: 1rem;
}

.content-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Resto de estilos (tabs, gráficos, etc.) se mantienen igual, solo corregimos colores si usan variables mal */

/* Formulario de creación de curso */
.form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-title {
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--secondary);
    font-size: 0.85rem;
}

/* Tarjetas de curso mejoradas */
.course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.course-image {
    height: 160px;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover .course-image img {
    transform: scale(1.05);
}

.course-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
    line-height: 1.3;
}

.course-info p {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    flex: 1;
}

.course-info small {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray);
}

.course-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(74, 108, 247, 0.05);
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .course-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}