/* Variables de colores pastel */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #7c4dff;
    --accent-color: #ff6b6b;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Estilos generales */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.container {
    position: relative;
    z-index: 1;
}

.container-fluid {
    position: relative;
    z-index: 1;
}

.main-content {
    position: relative;
    z-index: 1;
}

/* Navbar personalizado */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    padding: 0.5rem 0;
    z-index: 9999 !important;
    position: relative;
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.nav-link {
    color: white !important;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem !important;
    border-radius: 20px;
}

.nav-link:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.dropdown-menu {
    background-color: white;
    border: none;
    border-radius: 15px;
    box-shadow: var(--hover-shadow);
    margin-top: 5px;
    z-index: 9999 !important;
}

.dropdown-item {
    color: var(--text-color);
    padding: 8px 20px;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 2px 5px;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* ===== FOOTER CON TONALIDAD DE LA NAVEGACIÓN ===== */
.footer-brutal {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    padding: 20px 0;
}

.footer-brutal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: justify;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    justify-content: flex-start;
}

.footer-icon {
    font-size: 1.5rem;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.footer-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.footer-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0;
}

.footer-heading {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.footer-links li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links li a:hover {
    color: white;
    transform: translateX(3px);
}

.footer-links li a i {
    font-size: 0.7rem;
    width: 12px;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact-item i {
    color: white;
    width: 12px;
    font-size: 0.7rem;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 15px;
}

.copyright-text {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.copyright-text-simple {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.social-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .footer-contact {
        align-items: center;
    }
    
    .footer-copyright {
        grid-column: 1;
    }
}

/* Tarjetas */
.card {
    background: white;
    border: none;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    overflow: hidden;
    z-index: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    z-index: 2;
}

.card-header {
    background-color: var(--primary-color);
    border-radius: 15px 15px 0 0 !important;
    color: var(--text-color);
    font-weight: bold;
    position: relative;
    z-index: 1;
}

/* Botones */
.btn {
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    z-index: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

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

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

/* Tablas */
.table {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table thead {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: var(--primary-color);
    transform: scale(1.01);
}

/* Formularios */
.form-control {
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(170, 150, 218, 0.25);
}

/* Paginación */
.pagination {
    margin-top: 20px;
}

.page-link {
    color: var(--text-color);
    border: none;
    margin: 0 5px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Alertas */
.alert {
    border-radius: 15px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 9999;
    animation: slideInDown 0.5s ease-out;
}

/* Contenedor específico para mensajes flash */
.flash-messages {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 600px;
    pointer-events: none;
}

.flash-messages .alert {
    pointer-events: auto;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.alert-warning {
    background-color: var(--warning-color);
    color: var(--text-color);
}

.alert-info {
    background-color: var(--primary-color);
    color: white;
}

/* Animación para los mensajes flash */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Auto-ocultar mensajes después de 5 segundos */
.flash-messages .alert {
    animation: slideInDown 0.5s ease-out, fadeOut 0.5s ease-in 4.5s forwards;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 20px 0;
    margin-top: auto;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Spinner de carga */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .welcome-content {
        padding: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

@media (max-width: 992px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem !important;
    }
    
    .welcome-content h1 {
        font-size: 2.5rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
    
    .navbar-nav {
        z-index: 1040;
    }
    
    .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        z-index: 1040 !important;
    }
    
    .dropdown-item {
        color: white !important;
        padding: 8px 15px;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.2);
        color: white !important;
        transform: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.3rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem !important;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 0.9rem;
    }
    
    .filter-buttons {
        gap: 0.3rem;
    }
    
    .filter-buttons .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        flex: 1 1 calc(50% - 0.3rem);
        text-align: center;
        min-width: calc(50% - 0.3rem);
    }
    
    .modal-tipo-prestamo .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-tipo-prestamo .col-md-4 {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem !important;
    }
    
    .welcome-content h1 {
        font-size: 1.8rem;
    }
    
    .welcome-content p {
        font-size: 0.9rem;
    }
    
    .feature-card {
        padding: 15px;
    }
    
    .feature-card h3 {
        font-size: 1.2rem;
    }
    
    .feature-card p {
        font-size: 0.85rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 6px 15px;
    }
    
    .alert {
        margin: 10px;
        padding: 12px 15px;
        font-size: 0.9rem;
        z-index: 1040;
        position: relative;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .pagination {
        justify-content: center;
    }
    
    .page-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .filter-buttons .btn {
        margin: 2px;
        font-size: 0.8rem;
    }
}

/* Ajustes para dispositivos muy pequeños */
@media (max-width: 360px) {
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.2rem 0.3rem !important;
    }
    
    .welcome-content h1 {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 0.6rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
    }
    
    .feature-card p {
        font-size: 0.8rem;
    }
}

/* Ajustes para orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .welcome-container {
        min-height: auto;
        padding: 1rem 0;
    }
    
    .welcome-content {
        padding: 1rem;
    }
    
    .feature-card {
        margin-bottom: 0.5rem;
    }
}

/* Ajustes para tablets en modo retrato */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .welcome-content {
        padding: 2rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

/* Ajustes para tablets en modo paisaje */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .welcome-content {
        padding: 1.5rem;
    }
    
    .feature-card {
        padding: 1.2rem;
    }
}

/* Estilos para los filtros de materias */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-buttons .btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Estilos para el menú desplegable de materias */
.dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
    min-width: 250px;
}

.dropdown-header {
    font-weight: 600;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

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

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

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Estilizar la barra de desplazamiento del menú desplegable */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Estilos para los menús desplegables */
.dropdown-menu {
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 1050;
}

.dropdown-item {
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Asegurar que el contenedor del menú desplegable también tenga un z-index alto */
.navbar-nav .dropdown {
    position: relative;
    z-index: 1050;
}

/* Estilos para los filtros de materias */
.materias-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.materia-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.materia-chip:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
}

.materia-chip.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.materia-chip i {
    font-size: 0.8rem;
    margin-right: 0.3rem;
}

/* Ajustes responsive para los filtros */
@media (max-width: 768px) {
    .materias-container {
        gap: 0.5rem;
    }
    
    .materia-chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .materias-container {
        gap: 0.4rem;
    }
    
    .materia-chip {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* Estilos para el modal de selección de tipo de préstamo */
.modal-tipo-prestamo .modal-dialog {
    max-width: 800px;
}

.modal-tipo-prestamo .card {
    cursor: pointer;
    transition: all 0.3s ease;
    border-width: 2px;
    margin-bottom: 0;
}

.modal-tipo-prestamo .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.modal-tipo-prestamo .card:active {
    transform: translateY(-2px);
}

.modal-tipo-prestamo .card-header {
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    padding: 1rem;
}

.modal-tipo-prestamo .card-body {
    padding: 1.5rem;
}

.modal-tipo-prestamo .list-unstyled li {
    margin-bottom: 0.5rem;
}

/* Animación de entrada del modal */
.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.show .modal-dialog {
    transform: translate(0, 0) scale(1);
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .modal-tipo-prestamo .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-tipo-prestamo .col-md-4 {
        margin-bottom: 15px;
    }
}

/* Estilos específicos para modales - Asegurar funcionamiento correcto */
.modal {
    z-index: 10000 !important;
}

.modal-backdrop {
    z-index: 9999 !important;
}

.modal-dialog {
    z-index: 10001 !important;
}

.modal-content {
    z-index: 10002 !important;
    position: relative;
}

/* Asegurar que los enlaces dentro de modales sean clickeables */
.modal a {
    position: relative;
    z-index: 10003 !important;
    cursor: pointer;
}

.modal .card {
    position: relative;
    z-index: 10003 !important;
}

.modal .hover-card {
    position: relative;
    z-index: 10003 !important;
}

/* Override cualquier estilo que pueda interferir */
.modal.show {
    display: block !important;
    z-index: 10000 !important;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Asegurar que el botón de cerrar del modal sea clickeable */
.modal .btn-close {
    z-index: 10004 !important;
    position: relative;
}

.modal-header {
    z-index: 10003 !important;
    position: relative;
}

/* Estilos para campos de fecha */
input[type="date"] {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="date"]:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background-color: var(--primary-color);
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
    filter: invert(1);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: var(--secondary-color);
} 