/* Sistema de Egresados SIL - Estilos Personalizados */

:root {
    --primary-color: #12229D;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 56px; /* Altura del navbar */
}

/* Navbar Fixed */
.navbar.fixed-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    width: 100% !important;
}

.navbar .container-fluid {
    max-width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 56px);
    background: linear-gradient(180deg, #12229D 0%, #0d1a7a 100%);
    color: white;
    transition: all 0.3s ease;
    z-index: 1020;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header h5 {
    display: none;
}

.sidebar.collapsed .sidebar-menu a span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a .me-2 {
    margin-right: 0 !important;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .sidebar-header h5 span {
    display: none;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-header .btn-link {
    color: white !important;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
}

.sidebar-header .btn-link:hover {
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a i {
    min-width: 20px;
    text-align: center;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
}

.sidebar.collapsed .sidebar-menu a:hover {
    padding-left: 1rem;
}

.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-left: 4px solid #ffc107;
    font-weight: 600;
    color: #ffc107 !important;
}

.sidebar-menu a.active i {
    color: #ffc107 !important;
}

.sidebar.collapsed .sidebar-menu a.active {
    border-left: none;
    border-top: 4px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.2) !important;
}

.sidebar.collapsed .sidebar-menu a.active i {
    color: #ffc107 !important;
    font-size: 1.2rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
}

.sidebar-toggle-mobile {
    display: none;
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1031;
    border-radius: 50%;
    width: 45px;
    height: 45px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    padding-top: calc(2rem + 56px); /* Espacio para el navbar fijo */
    transition: all 0.3s ease;
    flex: 1;
    padding-bottom: 4rem;
    margin-top: 0;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d1a7a 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-card .icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stats-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stats-card .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tables */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d1a7a 100%);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

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

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Override Bootstrap primary colors */
.btn-primary,
.btn-primary:active,
.btn-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #0d1a7a !important;
    border-color: #0d1a7a !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.navbar.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(18, 34, 157, 0.25);
}

/* Breadcrumbs */
.breadcrumb {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Charts Container */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESPONSIVE DESIGN - Media Queries
   ============================================ */

/* Pantallas grandes (desktop) - 1200px y más */
@media (min-width: 1200px) {
    .main-content {
        padding: 2.5rem;
    }
    
    .card {
        margin-bottom: 2rem;
    }
}

/* Pantallas medianas grandes (laptop) - 992px a 1199px */
@media (min-width: 992px) and (max-width: 1199px) {
    .main-content {
        padding: 2rem;
    }
    
    .stats-card .value {
        font-size: 2.2rem;
    }
}

/* Pantallas medianas (tablets) - 768px a 991px */
@media (min-width: 768px) and (max-width: 991px) {
    body {
        padding-top: 56px;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 1.5rem;
        padding-top: calc(1.5rem + 56px);
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .stats-card {
        padding: 1.25rem;
    }
    
    .stats-card .value {
        font-size: 2rem;
    }
    
    .stats-card .icon {
        font-size: 2.5rem;
    }
    
    .chart-container {
        height: 350px;
        padding: 1rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.4rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .form-control, .form-select {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
}

/* Pantallas pequeñas (móviles grandes) - 576px a 767px */
@media (min-width: 576px) and (max-width: 767px) {
    body {
        padding-top: 56px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: calc(1.25rem + 56px);
    }
    
    .sidebar-toggle-mobile {
        display: block;
    }
    
    .card {
        margin-bottom: 1.25rem;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stats-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .stats-card .value {
        font-size: 1.75rem;
    }
    
    .stats-card .icon {
        font-size: 2rem;
    }
    
    .stats-card .label {
        font-size: 0.85rem;
    }
    
    .chart-container {
        height: 300px;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .table tbody td {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .form-control, .form-select {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* Pantallas muy pequeñas (móviles) - hasta 575px */
@media (max-width: 575px) {
    body {
        padding-top: 56px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(1rem + 56px);
    }
    
    .sidebar-toggle-mobile {
        display: block;
        top: 65px;
        left: 5px;
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .stats-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .stats-card .value {
        font-size: 1.5rem;
    }
    
    .stats-card .icon {
        font-size: 1.75rem;
    }
    
    .stats-card .label {
        font-size: 0.8rem;
    }
    
    .chart-container {
        height: 250px;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: white;
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .form-control, .form-select {
        padding: 0.55rem;
        font-size: 0.8rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    h3 {
        font-size: 1.15rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    h5 {
        font-size: 0.95rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar-brand i {
        font-size: 0.9rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between .btn {
        width: 100%;
    }
    
    .row.g-3 > * {
        margin-bottom: 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .breadcrumb {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Pantallas extra pequeñas - hasta 375px */
@media (max-width: 375px) {
    .main-content {
        padding: 0.75rem;
        padding-top: calc(0.75rem + 56px);
    }
    
    .card-header {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .stats-card {
        padding: 0.75rem;
    }
    
    .stats-card .value {
        font-size: 1.25rem;
    }
    
    .stats-card .icon {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 200px;
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .form-control, .form-select {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .navbar-brand {
        font-size: 0.85rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Footer */
footer {
    margin-top: auto;
    width: 100%;
    z-index: 100;
    position: relative;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Ajustes adicionales responsive para componentes específicos */

/* DataTables responsive */
@media (max-width: 767px) {
    .dataTables_wrapper {
        overflow-x: auto;
    }
    
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 1rem;
    }
    
    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
}

/* Formularios responsive */
@media (max-width: 767px) {
    .row.g-3 > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control,
    .input-group .btn {
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
}

/* Navbar responsive */
@media (max-width: 991px) {
    .navbar-nav {
        margin-top: 0.5rem;
    }
    
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Cards grid responsive */
@media (max-width: 767px) {
    .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
}

/* Botones de acción responsive */
@media (max-width: 575px) {
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .d-grid {
        gap: 0.5rem;
    }
}

/* Tablas responsive mejoradas */
@media (max-width: 575px) {
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .table tbody td[data-label]:before {
        min-width: 120px;
        text-align: left;
    }
}

/* Modales responsive */
@media (max-width: 575px) {
    .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }
    
    .modal-fullscreen-sm-down {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
}

/* Filtros responsive */
@media (max-width: 767px) {
    .card .card-body form .row {
        margin: 0;
    }
    
    .card .card-body form .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 0.75rem;
    }
}

/* Dashboard responsive */
@media (max-width: 991px) {
    .stats-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 575px) {
    .stats-card {
        text-align: center;
    }
    
    .stats-card .icon {
        margin-bottom: 0.5rem;
    }
}

/* Mejoras de accesibilidad y experiencia táctil */
@media (max-width: 767px) {
    /* Áreas táctiles más grandes en móviles */
    .btn, .sidebar-menu a, .navbar-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mejor espaciado para toques */
    .btn-group .btn {
        margin: 0.25rem;
    }
    
    /* Scroll suave */
    html {
        scroll-behavior: smooth;
    }
    
    /* Prevenir zoom en inputs en iOS */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Orientación landscape en móviles */
@media (max-width: 767px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Mejoras para tablets en modo portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .main-content {
        padding: 1.5rem;
    }
    
    .card {
        margin-bottom: 1.25rem;
    }
}

/* Ajustes para pantallas muy grandes */
@media (min-width: 1400px) {
    .main-content .container-fluid {
        max-width: 1320px;
        margin: 0 auto;
    }
    
    .navbar .container-fluid {
        max-width: 100%;
        margin: 0;
    }
    
    .main-content {
        padding: 3rem;
    }
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .sidebar-toggle-mobile {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .btn-group, .pagination {
        display: none !important;
    }
}

