/* ===================================
   Portal Digital FACSO - Estilos
   =================================== */

:root {
    --portal-blue: #2c4a8a;
    --portal-blue-dark: #1e3566;
    --portal-blue-light: #4a6fc5;
    --portal-teal: #1a7a7a;
    --portal-teal-dark: #145f5f;
    --portal-indigo: #5c4d9a;
    --portal-gradient: linear-gradient(135deg, #1e3566 0%, #2c4a8a 40%, #4a6fc5 100%);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    background: var(--portal-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Formas decorativas de fondo
   ============================================ */
.portal-bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    background: white;
}

.shape-1 {
    width: 500px;
    height: 500px;
    top: -120px;
    right: -100px;
    animation: floatShape 18s ease-in-out infinite;
}

.shape-2 {
    width: 350px;
    height: 350px;
    bottom: -80px;
    left: -60px;
    animation: floatShape 22s ease-in-out infinite reverse;
}

.shape-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatShape 15s ease-in-out infinite 3s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* ============================================
   Contenedor principal
   ============================================ */
.portal-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   Header del portal
   ============================================ */
.portal-header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.portal-logo {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: white;
    margin-bottom: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.portal-header h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.portal-header p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* ============================================
   Grid de aplicaciones
   ============================================ */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

/* ============================================
   Cards de aplicación
   ============================================ */
.portal-card {
    background: white;
    border-radius: 18px;
    padding: 2.25rem 1.75rem 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 12px 28px rgba(0, 0, 0, 0.12);
    border: 2px solid transparent;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease;
    animation: fadeInUp 0.7s ease-out both;
}

.portal-card:nth-child(1) { animation-delay: 0.05s; }
.portal-card:nth-child(2) { animation-delay: 0.15s; }
.portal-card:nth-child(3) { animation-delay: 0.25s; }
.portal-card:nth-child(4) { animation-delay: 0.35s; }

/* Hover glow effect */
.portal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    opacity: 0;
    background: linear-gradient(135deg, rgba(44, 74, 138, 0.04), rgba(74, 111, 197, 0.06));
    transition: opacity 0.3s ease;
}

a.portal-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 20px 40px rgba(0, 0, 0, 0.18);
    border-color: var(--portal-blue-light);
    color: inherit;
    text-decoration: none;
}

a.portal-card:hover::before {
    opacity: 1;
}

a.portal-card:hover .portal-card-icon {
    transform: scale(1.1) rotate(4deg);
}

/* Disabled card */
.portal-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    user-select: none;
}

/* ============================================
   Iconos de card
   ============================================ */
.portal-card-icon {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, var(--portal-blue) 0%, var(--portal-blue-light) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.2rem;
    margin-bottom: 1.25rem;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 12px rgba(44, 74, 138, 0.25);
}

.portal-card-icon.icon-teal {
    background: linear-gradient(135deg, var(--portal-teal) 0%, var(--portal-teal-dark) 100%);
    box-shadow: 0 4px 12px rgba(26, 122, 122, 0.25);
}

.portal-card-icon.icon-indigo {
    background: linear-gradient(135deg, var(--portal-indigo) 0%, #7b6bc4 100%);
    box-shadow: 0 4px 12px rgba(92, 77, 154, 0.25);
}

.portal-card-icon.icon-muted {
    background: linear-gradient(135deg, #8e99a4 0%, #adb5bd 100%);
    box-shadow: 0 4px 12px rgba(142, 153, 164, 0.2);
}

/* ============================================
   Texto de card
   ============================================ */
.portal-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--portal-blue-dark);
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

.portal-card-disabled h3 {
    color: #6c757d;
}

.portal-card p {
    color: #6c757d;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 1rem;
    flex-grow: 1;
}

/* ============================================
   Badges
   ============================================ */
.portal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.portal-badge-available {
    background-color: #e6f4ea;
    color: #1a7f37;
}

.portal-badge-soon {
    background-color: #fef3e2;
    color: #9a6700;
}

/* ============================================
   Footer
   ============================================ */
.portal-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    animation: fadeIn 1s ease-out 0.6s both;
}

.portal-footer p {
    margin: 0.2rem 0;
    font-size: 0.92rem;
}

.portal-footer-credit {
    font-size: 0.82rem !important;
    margin-top: 0.5rem !important;
    opacity: 0.7;
}

/* ============================================
   Animaciones
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portal-header h1 {
        font-size: 2rem;
    }

    .portal-header p {
        font-size: 1rem;
    }

    .portal-logo {
        width: 72px;
        height: 72px;
        font-size: 2.2rem;
    }

    .portal-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .portal-card {
        padding: 1.75rem 1.5rem;
    }

    .portal-container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .portal-header h1 {
        font-size: 1.65rem;
    }

    .portal-card h3 {
        font-size: 1.2rem;
    }

    .portal-card-icon {
        width: 64px;
        height: 64px;
        font-size: 1.8rem;
    }
}
