/* ==========================================================
   Estilos del Portal Educativo - IFCT0510
   Certificado de Profesionalidad: Gestión de Sistemas Informáticos
   Imagen Corporativa: FEI - Formación y Educación Integral
   ========================================================== */

:root {
    /* Colores corporativos FEI */
    --primary-color: #00A0D2;       /* Azul cian del logo */
    --primary-dark: #0088B5;        /* Azul cian oscuro */
    --primary-light: #4DC4E8;       /* Azul cian claro */
    --secondary-color: #F5A623;     /* Naranja/ámbar del logo */
    --secondary-dark: #D4901F;      /* Naranja oscuro */
    --secondary-light: #FFBD4A;     /* Naranja claro */

    /* Colores neutros */
    --dark-color: #1f2937;
    --text-color: #374151;
    --light-gray: #f8fafc;
    --white: #ffffff;

    /* Sombras */
    --card-shadow: 0 10px 25px -5px rgba(0, 160, 210, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 20px 40px -5px rgba(0, 160, 210, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, #006080 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.main-container {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 3rem;
    margin: 0 auto;
    max-width: 1400px;
}

/* ========== Header ========== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.header-logo {
    max-width: 180px;
    max-height: 100px;
    width: auto;
    height: auto;
    transition: transform 0.3s ease;
}

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

.teacher-info {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.teacher-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.teacher-title {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    opacity: 0.8;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.certificate-code {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 400;
}

/* ========== Stats Bar ========== */
.stats-bar {
    background: linear-gradient(135deg, rgba(0, 160, 210, 0.08), rgba(245, 166, 35, 0.08));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px solid rgba(0, 160, 210, 0.15);
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* ========== Search Bar ========== */
.search-bar {
    max-width: 450px;
    margin: 0 auto 3rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(0, 160, 210, 0.25);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 160, 210, 0.15);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

/* ========== Subject Cards ========== */
.subject-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 160, 210, 0.1);
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--secondary-color));
}

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

/* Estilos específicos para módulos formativos */
.subject-card.module-hardware::before {
    background: linear-gradient(90deg, #00A0D2, #4DC4E8);
}

.subject-card.module-software::before {
    background: linear-gradient(90deg, #0088B5, #00A0D2);
}

.subject-card.module-security::before {
    background: linear-gradient(90deg, #F5A623, #FFBD4A);
}

.card-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    opacity: 0.9;
}

.card-image.hardware::before {
    background: linear-gradient(135deg, #00A0D2, #4DC4E8);
}

.card-image.software::before {
    background: linear-gradient(135deg, #0088B5, #006080);
}

.card-image.security::before {
    background: linear-gradient(135deg, #F5A623, #D4901F);
}

.card-image i {
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1.4;
}

.card-code {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    text-align: center;
    margin-bottom: 1rem;
}

.card-duration {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--light-gray);
    border-radius: 20px;
    display: inline-block;
    width: 100%;
}

.card-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ========== Links ========== */
.subject-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subject-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subject-link:hover::before {
    opacity: 1;
}

.subject-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 160, 210, 0.35);
    color: white;
}

.subject-link i {
    margin-right: 0.5rem;
    position: relative;
    z-index: 1;
}

.subject-link span {
    position: relative;
    z-index: 1;
}

/* Estilos para carpetas/UF */
.folder-link {
    margin-bottom: 1rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    row-gap: 0.75rem;
}

.folder-header {
    font-weight: 600;
    color: var(--dark-color);
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 160, 210, 0.12), rgba(245, 166, 35, 0.08));
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
    border-left: 3px solid var(--primary-color);
}

.sublink {
    margin-left: 0;
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 120px;
}

/* ========== Animations ========== */
.loading-animation {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 2rem 0 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 160, 210, 0.15);
    color: #64748b;
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
    .sublink {
        flex: 1 1 100%;
    }
}

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

    .main-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .certificate-code {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .stats-bar {
        flex-direction: column;
        text-align: center;
    }

    .header-logo {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .subject-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}
