/* Original styles - keeping most of your CSS intact */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.header {
    background: linear-gradient(90deg, #08244e, #4c81be);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 70px;
    margin-right: 20px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.logo h1 {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.menu-icon {
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s;
}

.menu-icon:hover {
    transform: scale(1.1);
}

/* UPDATED: Resources Container - Main improvements for responsiveness */
.resources-container {
    max-width: 1400px; /* Aumentando el ancho máximo del contenedor */
    margin: 40px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px; /* Reducir un poco el espacio entre tarjetas */
    padding: 20px;
}

/* UPDATED: Resource Card - Improved responsiveness */

/* Modificación para tarjetas más anchas en pantalla completa */
.resource-card {
    /* Aumento el ancho para que sean más anchas en pantalla grande */
    width: calc(20% - 20px); /* Ligeramente más ancho (menos margen) */
    min-width: 220px; /* Aumentar el ancho mínimo para que sean más anchas */
    max-width: 280px; /* Añadiendo un ancho máximo para controlar el tamaño */
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.resource-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.resource-card::before {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(9, 33, 68, 0.7) 0%, rgba(21, 94, 178, 0.4) 100%);
    transition: all 0.5s ease;
    z-index: 0;
}

.resource-card:hover::before {
    top: 0;
}

.resource-content {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.resource-card:hover .resource-content {
    transform: translateY(-10px);
}

.resource-icon {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    transition: all 0.5s ease;
}

.resource-card:hover .resource-icon {
    transform: scale(1.1);
}

.resource-title {
    color: #0d47a1;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.resource-card:hover .resource-title {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.resource-description {
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.resource-card:hover .resource-description {
    color: white;
}

/* Icons styling */
.icon-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1000px;
}

.computer-icon {
    width: 100%;
    height: 100%;
    background-color: #e8f0fe;
    border-radius: 15px;
    border: 2px solid #434750;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.5s ease;
}

.resource-card:hover .computer-icon {
    transform: rotateY(180deg);
    background-color: transparent;
    border-color: transparent;
}

.icon-front, .icon-back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
}

.icon-back {
    transform: rotateY(180deg);
    opacity: 0;
}

.resource-card:hover .icon-front {
    opacity: 0;
}

.resource-card:hover .icon-back {
    opacity: 1;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
    transition: all 0.3s ease;
}

.resource-card:hover .badge {
    transform: scale(1.2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.badge-blue {
    background: linear-gradient(135deg, #0d47a1, #1976d2);
}

.badge-black {
    background: linear-gradient(135deg, #000000, #424242);
}

.badge-red {
    background: linear-gradient(135deg, #f44336, #e53935);
}

.badge-purple {
    background: linear-gradient(135deg, #2241a7, #3159c8);
}

.badge-sw {
    background: linear-gradient(135deg, #1a73e8, #4285f4);
}

/* Shiny effect on hover */
.resource-card:after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    opacity: 0;
    transform: rotate(30deg);
    background: rgba(255, 255, 255, 0.13);
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0.13) 0%,
        rgba(255, 255, 255, 0.13) 77%,
        rgba(255, 255, 255, 0.5) 92%,
        rgba(255, 255, 255, 0.0) 100%
    );
}

.resource-card:hover:after {
    opacity: 1;
    left: 130%;
    transition: all 0.7s ease;
}

/* Pulse animation for badges */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.resource-card:hover .badge {
    animation: pulse 1.5s infinite;
}

/* Footer - Fixed some issues with the footer */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, #08244e, #4c81be);
    color: white;
    text-align: center;
    padding: 15px;
    z-index: 1000;
}

@media (max-width: 1400px) {
    .resource-card {
        width: calc(25% - 20px); /* 4 tarjetas por fila */
        max-width: 260px;
    }
}

@media (max-width: 1200px) {
    .resource-card {
        width: calc(33.33% - 20px); /* 3 tarjetas por fila */
        max-width: 250px;
    }
}


/* UPDATED: Improved media queries for better responsiveness */
@media (max-width: 900px) {
    .resource-card {
        width: calc(50% - 20px); /* 2 cards per row for medium screens */
        max-width: none;
    }
    
    .logo h1 {
        font-size: 20px; /* Smaller title on medium screens */
    }
}

@media (max-width: 768px) {
    .resources-container {
        gap: 20px;
    }
    
    .resource-card {
        width: calc(50% - 20px); /* 2 cards per row, smaller gap */
        min-width: 200px;
    }
    
    .logo img {
        height: 50px; /* Smaller logo on mobile */
    }
    
    .logo h1 {
        font-size: 18px; /* Smaller title on mobile */
    }
    
    .footer {
        padding: 10px; /* Smaller footer padding on mobile */
    }
}

@media (max-width: 600px) {
    .resource-card {
        width: 100%; /* 1 tarjeta por fila en pantallas muy pequeñas */
    }
    
    .resources-container {
        padding: 10px;
        gap: 15px;
    }
    
    .header {
        padding: 10px;
    }
    
    .logo img {
        height: 40px;
        margin-right: 10px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
}

/* Make sure there's padding at the bottom to accommodate the fixed footer */
body {
    padding-bottom: 70px;
}