/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 3rem;
    color: #fbbf24;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
}

.intro-section h2 {
    font-size: 2.5rem;
    color: #1e40af;
    margin-bottom: 1rem;
    font-weight: 700;
}

.intro-section p {
    font-size: 1.2rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Portals Grid */
.portals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.portal-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transform: translateZ(0); /* Forzar aceleración por hardware */
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.portal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.portal-card:hover .portal-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

.portal-icon i {
    font-size: 2rem;
    color: white;
}

.portal-card h3 {
    font-size: 1.5rem;
    color: #1e40af;
    margin-bottom: 1rem;
    font-weight: 600;
}

.portal-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: rgba(30, 64, 175, 0.1);
    color: #1e40af;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
}

.feature-tag:hover {
    background: rgba(30, 64, 175, 0.2);
    transform: translateY(-1px);
}

.portal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.portal-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.portal-link:hover::before {
    left: 100%;
}

.portal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

/* Technical Info */
.tech-info {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.tech-info h3 {
    font-size: 1.8rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.tech-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 15px;
    background: #f8fafc;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.tech-item:hover {
    background: rgba(30, 64, 175, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tech-item i {
    font-size: 2.5rem;
    color: #1e40af;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.tech-item:hover i {
    transform: scale(1.2) rotate(10deg);
    color: #3b82f6;
}

.tech-item h4 {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.tech-item p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Features Overview */
.features-overview {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.features-overview h3 {
    font-size: 1.8rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.features-list {
    display: grid;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 15px;
    background: #f8fafc;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.feature-item:hover {
    background: rgba(30, 64, 175, 0.05);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feature-item i {
    font-size: 2rem;
    color: #1e40af;
    margin-top: 0.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.feature-item:hover i {
    transform: scale(1.3) rotate(-10deg);
    color: #3b82f6;
}

.feature-item h4 {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature-item p {
    color: #64748b;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footer-content p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .intro-section h2 {
        font-size: 2rem;
    }
    
    .intro-section p {
        font-size: 1rem;
    }
    
    .portals-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portal-card {
        padding: 1.5rem;
    }
    
    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .feature-item:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .intro-section h2 {
        font-size: 1.8rem;
    }
    
    .portal-card h3 {
        font-size: 1.3rem;
    }
    
    .tech-item {
        padding: 1rem;
    }
}

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

.portal-card {
    animation: fadeInUp 0.6s ease-out;
}

.portal-card:nth-child(2) {
    animation-delay: 0.1s;
}

.portal-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Estilos para enlaces externos */
.portal-link[target="_blank"]::after {
    content: '\f35d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 0.3rem;
    font-size: 0.8rem;
}

/* Efectos de carga */
.loading {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.loaded {
    opacity: 1;
}

/* Notificaciones */
.notification {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
}

.portal-link:active {
    transform: scale(0.95) !important;
}

/* Efectos adicionales */
.portal-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 20px;
}

.portal-card:hover::after {
    opacity: 1;
}

/* Asegurar que las tarjetas mantengan su posición en el grid */
.portals-grid .portal-card {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}