/**
 * Estilos principales - Formaciongamarra.es
 * Tonos azules, diseño moderno y profesional
 */

:root {
    --primary-blue: #0d6efd;
    --secondary-blue: #0a58ca;
    --light-blue: #cfe2ff;
    --dark-blue: #052c65;
    --accent-blue: #3d8bfd;
    --gradient-start: #0d6efd;
    --gradient-end: #0a58ca;
    --text-dark: #212529;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

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

html {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

/* Wrapper para el contenido principal */
main,
section:not(footer section),
.section {
    flex: 1 0 auto;
}

/* Footer siempre al final */
footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
}

/* Padding solo si hay navbar */
body:has(.navbar) {
    padding-top: 76px;
    /* Altura del navbar fijo */
}

/* Navbar personalizado */
.navbar {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.navbar-logo {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .navbar-logo {
        height: 40px;
        max-width: 150px;
    }
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--light-blue) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--light-blue);
}

/* Botones personalizados */
.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border: none;
    font-weight: 500;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--dark-blue) 100%);
}

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 500;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease;
}

/* Slider principal */
.swiper {
    width: 100%;
    height: 500px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.swiper-slide {
    position: relative;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.swiper-slide-active img {
    opacity: 0.5;
}

.swiper-slide-content {
    position: absolute;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    max-width: 90%;
}

.swiper-slide-content h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.swiper-slide-content p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
    width: 12px;
    height: 12px;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--light-blue);
    transform: scale(1.2);
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .swiper {
        height: 400px;
    }

    .swiper-slide-content {
        padding: 1.5rem;
    }

    .swiper-slide-content h2 {
        font-size: 1.75rem;
    }

    .swiper-button-next,
    .swiper-button-prev {
        width: 40px;
        height: 40px;
    }

    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 16px;
    }
}

/* Secciones */
.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    /* height: 100%; */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.1);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 1rem;
}

/* Animaciones de scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Imágenes con efecto parallax */
.parallax-image {
    transition: transform 0.3s ease;
}

/* Servicios */
.service-card {
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    background: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

/* Testimonios */
.testimonial-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 1rem;
    border-left: 4px solid var(--primary-blue);
    margin-bottom: 2rem;
}

.testimonial-author {
    font-weight: 600;
    color: var(--dark-blue);
    margin-top: 1rem;
}

/* Formularios */
.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    color: #ffffff !important;
}

footer h5,
footer h6 {
    color: #ffffff !important;
}

footer p,
footer li,
footer span {
    color: rgba(255, 255, 255, 0.75) !important;
}

footer a {
    color: rgba(255, 255, 255, 0.75) !important;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff !important;
}

footer .text-white-50 {
    color: rgba(255, 255, 255, 0.75) !important;
}

footer .text-light {
    color: #ffffff !important;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

.social-links a {
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Campus Virtual */
.campus-sidebar {
    background: var(--bg-light);
    min-height: calc(100vh - 76px);
    padding: 2rem 0;
}

.campus-content {
    padding: 2rem;
    min-height: calc(100vh - 76px);
}

.dashboard-card {
    border-left: 4px solid var(--primary-blue);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(5px);
}

/* Tablas */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

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

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Loading spinner */
.spinner-border-primary {
    color: var(--primary-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .swiper {
        height: 300px;
    }
}

/* Animaciones keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Utilidades */
.text-primary-custom {
    color: var(--primary-blue) !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

/* Estilos Responsive Adicionales para Nube y Videos */

/* Sidebar colapsable en móvil */
@media (max-width: 991px) {
    .campus-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1050;
        background: white;
        transition: left 0.3s;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .campus-sidebar.show {
        left: 0;
    }

    .campus-content {
        width: 100%;
    }
}

/* Grid adaptativo para nube de documentos */
@media (max-width: 576px) {
    #contenedorArchivos.vista-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .archivo-item {
        padding: 0.5rem !important;
    }

    .archivo-item i {
        font-size: 2rem !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    #contenedorArchivos.vista-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
}

@media (min-width: 769px) {
    #contenedorArchivos.vista-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* Tablas responsive con scroll horizontal */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Videos responsive */
.ratio {
    position: relative;
    width: 100%;
}

.ratio::before {
    content: "";
    display: block;
    padding-top: var(--bs-aspect-ratio);
}

.ratio>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Botones adaptados a pantalla táctil */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 1rem;
    }

    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }
}

/* Formularios responsive */
@media (max-width: 768px) {

    .form-control,
    .form-select {
        font-size: 16px;
        /* Evita zoom en iOS */
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Cards responsive */
@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .h3,
    .h4,
    .h5 {
        font-size: 1.25rem;
    }
}

/* Breadcrumbs responsive */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.875rem;
        flex-wrap: wrap;
    }

    .breadcrumb-item {
        white-space: nowrap;
    }
}

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

    .dashboard-card .fs-1 {
        font-size: 2rem !important;
    }
}

/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 1.5rem 0;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top: 3px solid var(--primary-blue);
}

.cookie-banner .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem 0;
    }

    .cookie-banner .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    .cookie-banner p {
        font-size: 0.875rem;
    }
}

/* Footer responsive */
@media (max-width: 768px) {
    footer .social-links {
        margin-top: 1rem;
    }

    footer .social-links a {
        margin-right: 0.75rem;
    }

    footer h6 {
        margin-top: 1.5rem;
    }

    footer h6:first-child {
        margin-top: 0;
    }
}

/* Estilos para dashboard alumno */
html,
body.alumno-dashboard {
    height: 100%;
}

body.alumno-dashboard {
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.alumno-dashboard .alumno-dashboard-container {
    flex: 1 0 auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding-top: 0;
    padding-bottom: 2rem;
}

.alumno-dashboard-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding-top: 0;
    padding-bottom: 2rem;
}

body.alumno-dashboard footer {
    flex-shrink: 0;
    width: 100%;
}

.alumno-dashboard-container .dashboard-header {
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-button {
    min-height: 180px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none !important;
    color: white !important;
    border: none;
}

.app-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: white !important;
}

.app-button i {
    font-size: 4rem !important;
}

.app-button span {
    font-size: 1.1rem;
}

/* Responsive app buttons */
@media (max-width: 768px) {
    .app-button {
        min-height: 140px;
    }

    .app-button i {
        font-size: 3rem !important;
    }

    .app-button span {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .app-button {
        min-height: 120px;
        padding: 1.5rem !important;
    }

    .app-button i {
        font-size: 2.5rem !important;
    }

    .app-button span {
        font-size: 0.85rem;
    }
}

/* Header Admin */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.dashboard-logo {
    height: 45px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .dashboard-logo {
        height: 35px;
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .admin-header .container-fluid {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-header .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .admin-logo {
        height: 35px;
        max-width: 150px;
    }
}

/* Ajustar padding del body cuando no hay navbar */
body.admin-body {
    padding-top: 0;
}

body.alumno-dashboard {
    padding-top: 0;
}

/* Sidebar admin siempre visible */
.campus-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    min-height: calc(100vh - 60px);
}

.admin-body .campus-sidebar {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Overlay de carga para backup */
.backup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.backup-overlay-content {
    text-align: center;
    padding: 2rem;
}

.backup-overlay-content h4 {
    font-weight: 600;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.backup-overlay .spinner-border {
    border-width: 0.5rem;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}