/* Global Styles */
:root {
    --header-height: 100px; /* Matches actual header height with logo */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    overflow-x: hidden;
}

/* Header */
.top-header {
    background-color: #fe2c55; /* PerúEduca primary red */
    color: white;
    padding: 10px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1030;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.brand-link {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.brand-link:hover {
    color: #f1f1f1;
}

.logo-img {
    border-radius: 50%;
    margin-right: 10px;
}

/* Layout Wrapper */
.main-wrapper {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ============================================
   SIDEBAR NAVIGATION - Modern Professional
   ============================================ */
.sidebar-nav {
    width: 64px;
    background: #1a1f2e;
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    z-index: 1020;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar-nav:hover {
    width: 260px;
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    gap: 12px;
    min-height: 70px;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: linear-gradient(135deg, #fe2c55, #ff6b81);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(254, 44, 85, 0.35);
}

.sidebar-brand-icon i {
    font-size: 1rem;
    color: #fff;
}

.sidebar-brand-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
}

.sidebar-nav:hover .sidebar-brand-text {
    opacity: 1;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 14px;
    flex-shrink: 0;
}

/* Sidebar Links */
.sidebar-links {
    display: flex;
    flex-direction: column;
    padding: 8px 8px;
    gap: 2px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.55);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: #fe2c55;
    border-radius: 0 3px 3px 0;
    transition: transform 0.25s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

/* Active state */
.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(254, 44, 85, 0.15), rgba(254, 44, 85, 0.05));
}

.sidebar-link.active::before {
    transform: translateY(-50%) scaleY(1);
    background: linear-gradient(180deg, #fe2c55, #ff6b81);
}

.sidebar-link.active .sidebar-link-icon {
    color: #fe2c55;
    background: rgba(254, 44, 85, 0.12);
}

/* Link Icon */
.sidebar-link-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.25s ease;
    color: inherit;
}

.sidebar-link:hover .sidebar-link-icon {
    color: #fe2c55;
    background: rgba(254, 44, 85, 0.08);
    transform: scale(1.08);
}

/* Link Text */
.sidebar-link-text {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    white-space: nowrap;
}

.sidebar-nav:hover .sidebar-link-text {
    opacity: 1;
}

/* Contact link special style */
.sidebar-link-contact {
    color: rgba(255, 255, 255, 0.45);
    margin-top: auto;
}

.sidebar-link-contact:hover {
    color: #ffffff;
    background: rgba(30, 136, 229, 0.1);
}

.sidebar-link-contact:hover .sidebar-link-icon {
    color: #42a5f5;
    background: rgba(30, 136, 229, 0.12);
}

.sidebar-link-contact:hover::before {
    background: #42a5f5;
}

/* Mobile Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fe2c55, #ff6b81);
    color: white;
    border: none;
    font-size: 1.4rem;
    z-index: 1050;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.4);
    cursor: pointer;
    transition: transform 0.3s;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 64px;
    padding: 20px 30px;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar-nav {
        width: 56px;
    }
    .sidebar-nav:hover {
        width: 240px;
    }
    .main-content {
        margin-left: 56px;
        padding: 15px 20px;
    }
}

@media (max-width: 767px) {
    .sidebar-nav {
        width: 0;
        transform: translateX(-100%);
    }
    .sidebar-nav.mobile-open {
        width: 260px;
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }
    .sidebar-nav.mobile-open .sidebar-link-text,
    .sidebar-nav.mobile-open .sidebar-brand-text {
        opacity: 1;
    }
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}


/* Banner Slider */
.carousel-item img {
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
}

/* Section Titles */
.section-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background-color: #fe2c55;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Cards (Noticias, Documentos) */
.card-custom {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    height: 100%;
}

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

.card-custom .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Colorful Badges for Sections */
.badge-doc { background-color: #1abc9c; color: white; }
.badge-news { background-color: #f39c12; color: white; }
.badge-video { background-color: #e74c3c; color: white; }

/* Footer */
.footer {
    background-color: #34495e;
    color: white;
    padding: 50px 0 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    margin-bottom: 8px;
}

.footer-links a:hover {
    color: white;
}

/* ============================================
   REPOSITORIO DE DOCUMENTOS - Modern Card Layout
   ============================================ */

/* Section Container */
.repositorio-section {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 50%, #e3ecf7 100%);
    padding: 50px 30px 40px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.repositorio-section::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(30, 136, 229, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.repositorio-section::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(254, 44, 85, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

/* Section Header */
.repositorio-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.repositorio-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.3);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.repositorio-header-icon i {
    font-size: 1.6rem;
    color: white;
}

.repositorio-header .section-title {
    color: #1a2b4a;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.repositorio-header .section-title::after {
    background: linear-gradient(90deg, #1e88e5, #fe2c55);
    width: 70px;
    height: 4px;
}

.repositorio-subtitle {
    color: #5a6a85;
    font-size: 0.95rem;
    max-width: 550px;
    margin: 12px auto 0;
    line-height: 1.5;
}

/* Document Filters Pill */
.repo-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.btn-filter {
    background-color: #fff;
    color: #5a6a85;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-filter:hover {
    background-color: #f1f5f9;
    color: #1e88e5;
    transform: translateY(-2px);
}

.btn-filter.active {
    background-color: #1e88e5;
    color: #fff;
    border-color: #1e88e5;
    box-shadow: 0 4px 10px rgba(30, 136, 229, 0.3);
}

/* Repository Card */
.repo-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
}

.repo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border-color: rgba(30, 136, 229, 0.15);
}

/* Card Image Area */
.repo-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.repo-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.repo-card:hover .repo-card-image img {
    transform: scale(1.05);
}

/* Placeholder when no image */
.repo-card-placeholder {
    width: 100%;
    height: 100%;
}

.placeholder-bg {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.placeholder-bg i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.placeholder-tipo {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Gradient Classes for Placeholders */
.grad-red    { background: linear-gradient(135deg, #e53935, #ef5350, #c62828); }
.grad-blue   { background: linear-gradient(135deg, #1e88e5, #42a5f5, #1565c0); }
.grad-green  { background: linear-gradient(135deg, #43a047, #66bb6a, #2e7d32); }
.grad-purple { background: linear-gradient(135deg, #7b1fa2, #ab47bc, #6a1b9a); }
.grad-orange { background: linear-gradient(135deg, #f57c00, #ffa726, #e65100); }

/* Badge on Image */
.repo-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #1565c0;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 5px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Card Body */
.repo-card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.repo-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a2b4a;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-card-desc {
    font-size: 0.85rem;
    color: #6b7c93;
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: justify;
}

/* Card Meta */
.repo-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f5;
}

.repo-card-date {
    font-size: 0.78rem;
    color: #8a96a8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.repo-card-date i {
    font-size: 0.85rem;
    color: #1e88e5;
}

/* Action Buttons */
.repo-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-repo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    cursor: pointer;
}

.btn-repo i {
    font-size: 0.9rem;
}

.btn-repo-download {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
}

.btn-repo-download:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.45);
    transform: translateY(-2px);
}

.btn-repo-view {
    background: transparent;
    color: #1e88e5;
    border: 2px solid #1e88e5;
}

.btn-repo-view:hover {
    background: #1e88e5;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
    transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .repositorio-section {
        padding: 35px 20px 30px;
        border-radius: 14px;
    }
    
    .repo-card-image {
        height: 190px;
    }
    
    .repositorio-header .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 767px) {
    .repositorio-section {
        padding: 25px 15px 20px;
        border-radius: 10px;
    }
    
    .repo-card-image {
        height: 180px;
    }
    
    .repo-card-actions {
        flex-direction: column;
    }
    
    .repositorio-header-icon {
        width: 50px;
        height: 50px;
    }
    
    .repositorio-header-icon i {
        font-size: 1.3rem;
    }
    
    .repositorio-header .section-title {
        font-size: 1.3rem;
    }
}

/* ============================================
   INTEGRANTES (EQUIPO) CARD STYLES
   ============================================ */
.integrante-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
}

.integrante-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

.integrante-header {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.integrante-foto {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    padding: 4px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
}

.integrante-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.integrante-foto-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 3rem;
}

.integrante-info-top h4 {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.25rem;
    margin-bottom: 5px;
}

.integrante-cargo {
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    background-color: #e0f2fe !important;
    color: #0284c7 !important;
}

.integrante-body {
    padding: 20px;
    flex-grow: 1;
}

.integrante-funciones p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 0;
}

.integrante-contacto h6 {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.integrante-contacto p {
    color: #334155;
}

.integrante-footer {
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: center;
}

.integrante-redes .rs-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s;
}

.integrante-redes .rs-icon:hover {
    transform: scale(1.1);
}

.integrante-redes .fb { background: #1877F2; }
.integrante-redes .tw { background: #000000; }
.integrante-redes .ig { background: #E4405F; }
.integrante-redes .li { background: #0A66C2; }
