/**
 * Estilos Mejorados - Sistema de Calificaciones
 * Instituto Cosme García Carranza
 * Diseño Profesional y Minimalista
 */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #0f172a;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-color: #334155;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* ====================== LAYOUT ====================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1.5rem;
}

/* ====================== HEADER MEJORADO ====================== */
.main-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-izquierdo {
    max-width: 65px;
    max-height: 65px;
}

.logo-derecho {
    max-width: 75px;
    max-height: 60px;
}

.system-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    letter-spacing: -0.025em;
}

.system-subtitle {
    font-size: 0.875rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-name {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.938rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
    padding: 0.375rem 0.875rem;
    border-radius: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ====================== NAVEGACIÓN MEJORADA ====================== */
.main-nav {
    background: var(--dark-color);
    padding: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-link.active {
    background: var(--primary-color);
    border-bottom-color: var(--primary-dark);
    color: white;
}

/* ====================== TARJETAS MEJORADAS ====================== */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    letter-spacing: -0.025em;
}

.card-body {
    padding: 1.5rem;
}

/* ====================== FORMULARIOS ====================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.938rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-select {
    cursor: pointer;
}

/* ====================== BOTONES MEJORADOS ====================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: white;
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.813rem;
}

/* ====================== TABLAS MEJORADAS ====================== */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
}

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

.table thead {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
}

.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.938rem;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ====================== BADGES ====================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* ====================== ALERTAS MEJORADAS ====================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* ====================== GRID MEJORADO ====================== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.col-1 { flex: 0 0 calc(8.333% - 1.5rem); }
.col-2 { flex: 0 0 calc(16.666% - 1.5rem); }
.col-3 { flex: 0 0 calc(25% - 1.5rem); }
.col-4 { flex: 0 0 calc(33.333% - 1.5rem); }
.col-6 { flex: 0 0 calc(50% - 1.5rem); }
.col-8 { flex: 0 0 calc(66.666% - 1.5rem); }
.col-9 { flex: 0 0 calc(75% - 1.5rem); }
.col-12 { flex: 0 0 100%; }

/* ====================== DROPDOWN MEJORADO ====================== */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .nav-link {
    cursor: pointer;
    user-select: none;
}

.nav-item.dropdown .nav-link::after {
    content: ' ▼';
    font-size: 0.65em;
    margin-left: 0.4em;
    opacity: 0.8;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 240px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
    border: 1px solid var(--border-color);
    border-top: none;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu .dropdown-item {
    display: block;
    padding: 0.875rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.dropdown-menu .dropdown-item:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.dropdown-menu .dropdown-item.active {
    background: var(--primary-color);
    color: white;
}

/* ====================== UTILIDADES ====================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--secondary-color); }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-100 { width: 100%; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 968px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .nav-list {
        flex-direction: column;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255,255,255,0.05);
        border-left: 3px solid var(--primary-color);
        margin-left: 1rem;
    }
    
    .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-6, .col-8, .col-9 {
        flex: 0 0 100%;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
}
