:root {
    --bg-dark: #030712;
    --card-bg: rgba(15, 23, 42, 0.75);
    --accent-blue: #38bdf8;
    --primary-blue: #2563eb;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --border-color: rgba(56, 189, 248, 0.25);
    --inner-card: rgba(30, 41, 59, 0.5);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-x: hidden;
    position: relative;
}

/* --- FONDO ANIMADO TIPO INTERESTELAR --- */
.space-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.stars-small {
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: 
        15vw 10vh #fff, 35vw 25vh #fff, 85vw 15vh #fff, 60vw 45vh #fff, 20vw 70vh #fff,
        75vw 80vh #fff, 90vw 50vh #fff, 10vw 85vh #fff, 40vw 90vh #fff, 50vw 15vh #fff,
        5vw 35vh #fff, 95vw 10vh #fff, 80vw 30vh #fff, 30vw 60vh #fff, 65vw 70vh #fff,
        12vw 45vh #fff, 48vw 38vh #fff, 72vw 92vh #fff, 88vw 78vh #fff, 28vw 18vh #fff;
    animation: starPulse 4s ease-in-out infinite alternate;
}

.stars-medium {
    width: 2px;
    height: 2px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 
        25vw 15vh #38bdf8, 70vw 20vh #60a5fa, 15vw 55vh #fff, 80vw 65vh #38bdf8,
        45vw 75vh #fff, 90vw 85vh #60a5fa, 35vw 35vh #38bdf8, 60vw 85vh #fff,
        10vw 20vh #60a5fa, 55vw 50vh #38bdf8, 78vw 40vh #fff, 22vw 90vh #60a5fa;
    animation: starPulse 2.5s ease-in-out infinite alternate 1s;
}

.stars-large {
    width: 3px;
    height: 3px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 
        18vw 40vh #38bdf8, 62vw 12vh #fff, 82vw 75vh #60a5fa,
        42vw 82vh #38bdf8, 8vw 68vh #fff, 92vw 28vh #38bdf8;
    animation: starGlow 3s ease-in-out infinite alternate;
}

@keyframes starPulse {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

@keyframes starGlow {
    0% { opacity: 0.3; filter: drop-shadow(0 0 2px #38bdf8); }
    100% { opacity: 1; filter: drop-shadow(0 0 8px #38bdf8); }
}

.nebula {
    position: fixed;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, rgba(56, 189, 248, 0.08) 40%, rgba(3, 7, 18, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    animation: pulseNebula 10s ease-in-out infinite alternate;
}

@keyframes pulseNebula {
    0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
}

/* --- TARJETA PRINCIPAL --- */
.card {
    position: relative;
    z-index: 10;
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    max-width: 620px;
    width: 100%;
    padding: 40px 36px 36px;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(56, 189, 248, 0.2);
    text-align: center;
}

/* Botón de volver al Grupo */
.back-group {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.back-group:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
    transform: translateX(-3px);
}

header {
    margin-top: 20px;
}

header h1 {
    font-size: 2.4rem;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.welcome-badge {
    display: inline-block;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(56, 189, 248, 0.25));
    color: var(--accent-blue);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

/* PERFIL CON AVATAR DESTACADO */
.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 32px;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-blue);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.04);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.8);
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-light);
}

.profile-name span {
    color: var(--accent-blue);
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.nav-title, .section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 36px;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav a::after {
    content: '→';
    color: var(--accent-blue);
    transition: transform 0.3s ease;
}

nav a:hover {
    background: linear-gradient(90deg, var(--primary-blue), #1d4ed8);
    border-color: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    transform: translateY(-2px);
}

nav a:hover::after {
    transform: translateX(4px);
    color: #ffffff;
}

/* --- SECCIONES INSTITUCIONAL Y ACADÉMICA --- */
.info-card {
    background: var(--inner-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-card h3 {
    color: var(--accent-blue);
    font-size: 1.05rem;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    padding-bottom: 8px;
}

.info-card p {
    margin-bottom: 6px;
    color: var(--text-light);
}

.info-card strong {
    color: var(--accent-blue);
}

/* Historial Académico */
.academic-year {
    margin-top: 16px;
}

.year-title {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 1rem;
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(56, 189, 248, 0.3);
    padding-bottom: 4px;
}

.subject-list {
    list-style: none;
    padding: 0;
}

.subject-list li {
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.subject-list li:last-child {
    border-bottom: none;
}

.status-en-curso {
    color: #f1c40f;
    font-weight: 500;
}

.status-aprobado {
    color: #2ecc71;
    font-weight: 500;
}

/* Progreso de la carrera */
.progress-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.8));
    border: 1px solid var(--accent-blue);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.progress-box h4 {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    height: 100%;
    width: 70.37%;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--accent-blue);
}

.progress-text {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 600;
}

footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
    text-align: justify;
}