/* CNV Admin - Estilos del panel de administración */

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

body {
    font-family: 'Open Sans', sans-serif;
    background: #f5f7f2;
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(135deg, #5D6D3F 0%, #4a5832 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.navbar-brand img {
    height: 35px;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.navbar-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active { color: white; }

.navbar-user { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-logout:hover { background: rgba(255, 255, 255, 0.25); }

.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { color: #4A5D6A; font-size: 1.75rem; font-weight: 600; }

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.card-title { font-size: 1.1rem; font-weight: 600; color: #4A5D6A; }

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #8B9A5B, #5D6D3F);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(93, 109, 63, 0.3);
    transform: translateY(-1px);
}

.btn-secondary { background: #f0f0f0; color: #555; }
.btn-secondary:hover { background: #e5e5e5; }

.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #4A5D6A;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover { background: #fafafa; }

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-warning { background: #fff3cd; color: #856404; }

.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #4A5D6A; }

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus { outline: none; border-color: #8B9A5B; }

textarea.form-control { min-height: 200px; resize: vertical; }

.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input { width: 18px; height: 18px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stat-value { font-size: 2rem; font-weight: 600; color: #5D6D3F; }
.stat-label { color: #6B7B6E; font-size: 0.9rem; margin-top: 0.25rem; }

/* ============================================
   PAGINACIÓN - Estilos para Laravel/Tailwind
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Ocultar la versión móvil de Laravel */
.pagination nav > div:first-child {
    display: none !important;
}

/* Contenedor principal de paginación */
.pagination nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pagination nav > div {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Texto "Showing X to Y of Z results" */
.pagination nav p,
.pagination nav .text-sm {
    color: #6B7B6E;
    font-size: 0.85rem;
    margin: 0;
}

.pagination nav p span,
.pagination nav .font-medium {
    font-weight: 600;
    color: #4A5D6A;
}

/* Contenedor de los botones de página */
.pagination nav span.relative,
.pagination nav .inline-flex,
.pagination nav .shadow-sm {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 8px;
    overflow: hidden;
}

/* Todos los elementos de paginación (números y flechas) */
.pagination nav a,
.pagination nav span[aria-current],
.pagination nav span[aria-disabled],
.pagination nav span.relative > span,
.pagination nav span.relative > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: #5D6D3F;
    background: white;
    border: 1px solid #ddd;
    border-right: none;
    transition: all 0.2s;
    cursor: pointer;
}

/* Primer elemento - borde izquierdo redondeado */
.pagination nav span.relative > span:first-child,
.pagination nav span.relative > a:first-child {
    border-radius: 8px 0 0 8px;
}

/* Último elemento - borde derecho redondeado */
.pagination nav span.relative > span:last-child,
.pagination nav span.relative > a:last-child {
    border-radius: 0 8px 8px 0;
    border-right: 1px solid #ddd;
}

/* Hover en enlaces */
.pagination nav a:hover {
    background: #f0f4eb;
    color: #4a5832;
    border-color: #c4d4c0;
}

/* Página actual */
.pagination nav span[aria-current] span,
.pagination nav .bg-white.cursor-default,
.pagination nav span.relative > span[aria-current="page"] span {
    background: #5D6D3F !important;
    color: white !important;
    border-color: #5D6D3F !important;
    font-weight: 600;
}

/* Elementos deshabilitados (flechas cuando no hay más páginas) */
.pagination nav span[aria-disabled] span,
.pagination nav .cursor-default {
    color: #aaa;
    background: #f5f5f5;
    cursor: not-allowed;
}

/* SVG de las flechas */
.pagination nav svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Flechas deshabilitadas */
.pagination nav span[aria-disabled] svg {
    fill: #bbb;
}

/* Arreglar clases de Tailwind que interfieren */
.pagination .flex { display: flex; }
.pagination .items-center { align-items: center; }
.pagination .justify-between { justify-content: space-between; }
.pagination .hidden { display: none !important; }
.pagination .sm\:hidden { display: none !important; }
.pagination .sm\:flex-1 { flex: 1; }
.pagination .sm\:flex { display: flex !important; }
.pagination .sm\:items-center { align-items: center; }
.pagination .sm\:justify-between { justify-content: space-between; }

/* Estilo alternativo más simple para paginación */
.pagination-simple {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination-simple a,
.pagination-simple span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: #5D6D3F;
    background: white;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-simple a:hover {
    background: #f0f4eb;
    border-color: #c4d4c0;
}

.pagination-simple .active,
.pagination-simple span[aria-current] {
    background: #5D6D3F;
    color: white;
    border-color: #5D6D3F;
}

.pagination-simple .disabled {
    color: #aaa;
    background: #f5f5f5;
    cursor: not-allowed;
}

/* ============================================ */

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.filters .form-group { margin-bottom: 0; }
.filters .form-control { padding: 0.5rem; font-size: 0.9rem; }

.text-muted { color: #6c757d; }
.text-center { text-align: center; }
.text-success { color: #5D6D3F; }
.text-warning { color: #E8913A; }
.text-danger { color: #dc3545; }

.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }

.actions { display: flex; gap: 0.5rem; }

.progress-mini {
    width: 60px; height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.progress-mini-bar { height: 100%; border-radius: 4px; transition: width 0.3s ease; }

.results-visual { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.result-item {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: default;
}

.result-item.correct { background: #5D6D3F; }
.result-item.incorrect { background: #dc3545; }
.result-item small { font-size: 0.65rem; margin-top: -2px; }

.exercise-detail {
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.exercise-correct { background: #f8fdf8; border-color: #5D6D3F; }
.exercise-incorrect { background: #fdf8f8; border-color: #dc3545; }

.exercise-header { display: flex; align-items: center; margin-bottom: 0.75rem; }

.exercise-number {
    width: 32px; height: 32px;
    background: #4A5D6A;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.exercise-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.exercise-caso {
    color: #4A5D6A;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
}

.exercise-options { display: flex; flex-direction: column; gap: 0.5rem; }

.option {
    padding: 0.6rem 0.75rem;
    background: white;
    border-radius: 6px;
    font-size: 0.95rem;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-correct { background: #d4edda; border-color: #c3e6cb; }
.option-wrong { background: #f8d7da; border-color: #f5c6cb; }

.option-label {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.option-label.correct { background: #5D6D3F; color: white; }
.option-label.wrong { background: #dc3545; color: white; }

.exercise-open-answer {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.exercise-open-answer p { margin: 0.5rem 0 0 0; color: #4A5D6A; }

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(93, 109, 63, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header img { height: 50px; margin-bottom: 1rem; }
.login-header h1 { color: #4A5D6A; font-size: 1.5rem; font-weight: 600; }
.login-header p { color: #6B7B6E; font-size: 0.95rem; margin-top: 0.5rem; }

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #8B9A5B 0%, #5D6D3F 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    box-shadow: 0 6px 20px rgba(93, 109, 63, 0.4);
    transform: translateY(-2px);
}
