/* myfirst.css - Estilos unificados con paleta ULagos */

:root {
    --ulagos-blue: #003DA6;
    --ulagos-green: #76BC21;
    --ulagos-yellow: #FFB71B;
    --ulagos-red: #CA3625;
    --ulagos-purple: #7E57C5;
    --ulagos-orange: #FF671D;
    --ulagos-dark-green: #47712C;
    --ulagos-dark-blue: #002760;
}

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

html {
    scroll-padding-top: 80px;  /* Espacio para el navbar sticky */
    scroll-behavior: smooth;
}

/* Asegurar que el contenido principal no se solape con el navbar */
main {
    display: block;
    position: relative;
    z-index: 1;
}

/* Estilos base - Ajuste dinámico para navbar fijo */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);

    min-height: 100vh;
}


/* Header institucional - usando azul ULagos */
.navbar-custom {
    background: linear-gradient(135deg, var(--ulagos-dark-blue) 0%, var(--ulagos-blue) 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 61, 166, 0.2);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
    color: white !important;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .nav-link:hover {
    opacity: 0.9;
}

/* Dropdown menu estilizado */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border: none;
    margin-top: 8px;
}

.dropdown-item {
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--ulagos-blue) 0%, var(--ulagos-dark-blue) 100%);
    color: white;
}

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

/* Tarjeta principal - con acento azul ULagos */
.main-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 61, 166, 0.1);
    background: white;
    overflow: hidden;
    border-left: 4px solid var(--ulagos-blue);
    transition: all 0.3s ease;
}

.main-card:hover {
    box-shadow: 0 8px 20px rgba(0, 61, 166, 0.15);
}

.main-card h1 {
    color: var(--ulagos-blue);
    font-weight: 600;
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--ulagos-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--ulagos-dark-blue);
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Grid de cursos - ocupa todo el ancho disponible */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    width: 100%;
}

/* Tarjetas de cursos - altura consistente y ancho flexible */
.course-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 61, 166, 0.1);
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 61, 166, 0.2);
}

/* Header de las tarjetas - ALTURA FIJA */
.card-header-custom {
    background: linear-gradient(135deg, var(--ulagos-dark-blue) 0%, var(--ulagos-blue) 100%);
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    height: 80px;
    display: flex;
    align-items: center;
    width: 100%;
}

.card-header-custom h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}

.card-header-custom h3 a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
    width: 100%;
}

.card-header-custom h3 a i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Cuerpo de las tarjetas */
.course-card .card-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Código y grupo del curso */
.course-card .card-body > .text-muted {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    word-break: break-word;
    font-size: 0.85rem;
}

/* Meta información */
.course-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem 0;
    font-size: 0.8rem;
    color: #6c757d;
    flex-shrink: 0;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-word;
}

.course-meta i {
    color: var(--ulagos-blue);
    width: 18px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* Enlaces de Zoom y Drive */
.course-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem 0;
    flex-shrink: 0;
}

.course-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.course-links a i {
    font-size: 0.85rem;
}

/* Botón de ingresar al curso - siempre al final */
.btn-course {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--ulagos-dark-blue) 0%, var(--ulagos-blue) 100%);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    margin-top: auto;
    border: none;
    cursor: pointer;
    gap: 8px;
    width: 100%;
    font-size: 0.9rem;
}

.btn-course:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, #001a4d 0%, var(--ulagos-dark-blue) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 61, 166, 0.3);
}

.btn-course i {
    transition: transform 0.3s ease;
    font-size: 0.85rem;
}

.btn-course:hover i {
    transform: translateX(4px);
}

/* Avatar de usuario */
.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* Ocultar elementos de admin */
.block_settings,
#block-region-side-pre,
.adminsearchform {
    display: none !important;
}

.region-main {
    width: 100% !important;
}

/* Estilos para alertas */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #fff5f5 100%);
    color: #721c24;
    border-left: 4px solid var(--ulagos-red);
}

/* Alertas de éxito con verde ULagos */
.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f0 100%);
    color: var(--ulagos-dark-green);
    border-left: 4px solid var(--ulagos-green);
}

/* Alertas de advertencia con amarillo ULagos */
.alert-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #fffef5 100%);
    color: #856404;
    border-left: 4px solid var(--ulagos-yellow);
}

/* Alertas de asistencia con azul ULagos - Versión con mayor especificidad */
.alert.alert-attendance {
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e2fc 100%) !important;
    color: var(--ulagos-dark-blue) !important;
    border-left: 4px solid var(--ulagos-blue) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 10px !important;
}

/* Botón de asistencia azul ULagos - Versión con mayor especificidad */
.btn.btn-attendance {
    background: linear-gradient(135deg, var(--ulagos-blue) 0%, var(--ulagos-dark-blue) 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 6px rgba(0, 61, 166, 0.25) !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn.btn-attendance:hover {
    background: linear-gradient(135deg, var(--ulagos-dark-blue) 0%, #001a4d 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 61, 166, 0.35) !important;
    color: white !important;
}

.btn.btn-attendance:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px rgba(0, 61, 166, 0.2) !important;
}

.btn.btn-attendance i {
    color: white !important;
}

/* Badges con colores ULagos */
.badge-blue {
    background: var(--ulagos-blue);
    color: white;
}

.badge-green {
    background: var(--ulagos-green);
    color: white;
}

.badge-yellow {
    background: var(--ulagos-yellow);
    color: #333;
}

.badge-orange {
    background: var(--ulagos-orange);
    color: white;
}

.badge-purple {
    background: var(--ulagos-purple);
    color: white;
}

/* Responsive */
@media (max-width: 850px) {
    html {
        scroll-padding-top: 95px;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 110px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .navbar-custom {
        padding: 0.6rem 0.8rem;
        min-height: auto;
    }
    
    .card-header-custom {
        height: 70px;
        padding: 0.8rem 1rem;
    }
    
    .card-header-custom h3 {
        font-size: 1rem;
    }
    
    .card-header-custom h3 a {
        gap: 8px;
    }
    
    .card-header-custom h3 a i {
        font-size: 1.1rem;
    }
    
    .course-card .card-body {
        padding: 1rem;
    }
    
    .course-meta {
        gap: 0.4rem;
        margin: 0.4rem 0 0.6rem 0;
    }
    
    .btn-course {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .platform-change-wrapper {
        margin-left: 10px;
    }
    
    .platform-change-wrapper .btn-course {
        padding: 6px 12px !important;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    html {
        scroll-padding-top: 120px;
    }
}

@media (max-width: 480px) {
    html {
        scroll-padding-top: 130px;
    }
    
    .courses-grid {
        gap: 0.75rem;
    }
    
    .card-header-custom {
        height: 60px;
        padding: 0.6rem 0.8rem;
    }
    
    .card-header-custom h3 {
        font-size: 0.9rem;
    }
    
    .course-card .card-body {
        padding: 0.75rem;
    }
    
    .course-card .card-body > .text-muted {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .course-meta {
        font-size: 0.7rem;
        gap: 0.3rem;
        margin: 0.3rem 0 0.5rem 0;
    }
    
    .course-meta i {
        width: 16px;
        font-size: 0.75rem;
    }
    
    .course-links {
        gap: 0.35rem;
        margin: 0.4rem 0 0.6rem 0;
    }
    
    .course-links a {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .btn-course {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* Scrollbar personalizada con colores ULagos */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--ulagos-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ulagos-dark-blue);
}

/* Contenedor para el botón de cambio de plataforma - alineado a la izquierda */
.platform-change-wrapper {
    margin-right: auto; 
    margin-left: 20px;  
}

/* Asegurar que el botón mantenga su estilo original */
.platform-change-wrapper .btn-course {
    margin: 0;          
    white-space: nowrap; 
}

/* Ajustes responsive para móviles */
@media (max-width: 768px) {
    .platform-change-wrapper {
        margin-left: 10px;
    }
    
    .platform-change-wrapper .btn-course {
        padding: 6px 12px !important;
        font-size: 0.9rem;
    }
}



/* WhatsApp Float Button - Estilos para el botón flotante */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25D366;
    color: white;
    border-radius: 50px;
    padding: 12px 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
    border: none;
    cursor: pointer;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
}

.whatsapp-float i {
    font-size: 24px;
}

/* Versión solo ícono para móviles muy pequeños */
@media (max-width: 480px) {
    .whatsapp-float span {
        display: none;  /* Oculta el texto en móviles muy pequeños */
    }
    
    .whatsapp-float {
        padding: 12px;
        border-radius: 50px;
    }
    
    .whatsapp-float i {
        margin: 0;
    }
}

/* Ajuste para tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .whatsapp-float {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .whatsapp-float i {
        font-size: 20px;
    }
}

/* Animación sutil de pulso para llamar la atención (opcional) */
@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-float {
    animation: pulse-whatsapp 2s infinite;
}

/* Opcional: efecto de entrada suave */
.whatsapp-float {
    animation: pulse-whatsapp 2s infinite, fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para la cuadrícula de archivos de Drive */
.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
    width: 100%;
}

/* Tarjeta individual de archivo */
.drive-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem 0.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    min-width: 0; /* Previene desbordamiento */
}

.drive-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background: white;
    border-color: #dee2e6;
    text-decoration: none;
}

/* Icono del archivo */
.drive-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

/* Nombre del archivo - con truncamiento */
.drive-name {
    font-size: 0.8rem;
    color: #495057;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Colores específicos para tipos de archivo */
.drive-card .fa-file-video,
.drive-card .fa-video {
    color: #dc3545; /* Rojo para videos */
}

.drive-card .fa-file-pdf {
    color: #e74c3c; /* Rojo característico PDF */
}

.drive-card .fa-file-powerpoint,
.drive-card .fa-chalkboard {
    color: #e67e22; /* Naranja para presentaciones */
}

.drive-card .fa-file-word,
.drive-card .fa-file-alt,
.drive-card .fa-file-lines {
    color: #2c7da0; /* Azul para documentos */
}

.drive-card .fa-file-excel {
    color: #27ae60; /* Verde para Excel */
}

.drive-card .fa-folder {
    color: #f39c12; /* Amarillo para carpetas */
}

.drive-card .fa-image {
    color: #8e44ad; /* Púrpura para imágenes */
}

/* Responsive: más columnas en pantallas pequeñas */
@media (max-width: 768px) {
    .drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.75rem;
    }
    
    .drive-icon {
        font-size: 2rem;
    }
    
    .drive-name {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.5rem;
    }
    
    .drive-card {
        padding: 0.75rem 0.25rem;
    }
    
    .drive-icon {
        font-size: 1.6rem;
    }
    
    .drive-name {
        font-size: 0.65rem;
    }
}