@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Open+Sans:wght@400;600&family=Source+Code+Pro:wght@400;600&display=swap');

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --azul:       #1a508b;
    --azul-dark:  #0f3460;
    --amarillo:   #f1c40f;
    --naranja:    #e67e22;
    --naranja-dark: #d35400;
    --blanco:     #ffffff;
    --fondo:      #f0f4f8;
    --texto:      #2c3e50;
    --gris:       #7f8c8d;
    --verde:      #27ae60;
    --rojo:       #e74c3c;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--fondo);
    color: var(--texto);
    font-family: 'Open Sans', sans-serif;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 { font-family: 'Montserrat', sans-serif; color: var(--azul); }

/* ===== INACTIVITY OVERLAY ===== */
#inactivity-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 52, 96, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    text-align: center;
    padding: 20px;
}
#inactivity-overlay.show { display: flex; }
#inactivity-overlay h2 { font-size: 1.8rem; margin-bottom: 12px; color: var(--amarillo); }
#inactivity-overlay p  { font-size: 1rem; margin-bottom: 24px; }
#inactivity-overlay button {
    padding: 12px 30px; background: var(--naranja);
    color: white; border: none; border-radius: 25px;
    font-size: 1rem; font-weight: bold; cursor: pointer;
}
#inactivity-overlay button:hover { background: var(--naranja-dark); }

/* ===== ROLE BADGE ===== */
.role-badge {
    display: inline-block; padding: 3px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; margin-left: 8px; vertical-align: middle;
}
.role-admin    { background: var(--rojo);    color: white; }
.role-docente  { background: var(--azul);    color: white; }
.role-alumno   { background: var(--verde);   color: white; }

/* ===== LOGIN ===== */
.login-body {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--azul-dark) 0%, var(--azul) 50%, #f1c40f44 100%);
}

.login-container {
    background: white; padding: 45px 40px; border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25); text-align: center;
    width: 100%; max-width: 420px;
    border-bottom: 6px solid var(--naranja);
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-logo {
    width: 50px; /* Cambia "150px" por el tamaño que necesites */
    height: auto; /* Mantiene las proporciones originales para que no se deforme */
}
.login-container h1 { font-size: 2rem; margin-bottom: 4px; }
.login-container > p { color: var(--gris); font-size: 0.9rem; margin-bottom: 5px; }

.login-container form {
    display: flex; flex-direction: column; text-align: left; margin-top: 24px;
}
.login-container label { font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }
.login-container input {
    width: 100%; margin-bottom: 16px; padding: 13px 16px;
    border: 2px solid #dde3ec; border-radius: 10px;
    outline: none; transition: 0.3s; font-size: 0.95rem;
    background: #f8fafc;
}
.login-container input:focus { border-color: var(--azul); background: white; }

.login-container button {
    width: 100%; padding: 14px; background-color: var(--naranja);
    color: white; border: none; border-radius: 10px;
    font-weight: 700; cursor: pointer; font-size: 1rem; margin-top: 8px;
    transition: 0.3s; letter-spacing: 0.3px;
}
.login-container button:hover { background-color: var(--naranja-dark); transform: translateY(-1px); }

.footer-login { margin-top: 22px; color: var(--gris); font-size: 0.88rem; }
.footer-login a { color: var(--azul); font-weight: 700; text-decoration: none; }
.footer-login a:hover { text-decoration: underline; }

.error   { color: var(--rojo);  font-weight: 600; margin: 10px 0; font-size: 0.9rem; }
.success { color: var(--verde); font-weight: 600; margin: 10px 0; font-size: 0.9rem; }

/* ===== ROLE SELECT ===== */
.role-select {
    width: 100%; margin-bottom: 16px; padding: 13px 16px;
    border: 2px solid #dde3ec; border-radius: 10px;
    outline: none; font-size: 0.95rem; background: #f8fafc;
    color: var(--texto); transition: 0.3s; cursor: pointer;
}
.role-select:focus { border-color: var(--azul); background: white; }

/* ===== NAVBAR ===== */
.navbar {
    background-color: var(--azul-dark);
    padding: 0 5%;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 4px solid var(--amarillo);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    min-height: 65px;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.navbar-brand .logo-icon { font-size: 1.6rem; }
.navbar h2 { color: var(--amarillo); font-size: 1.4rem; letter-spacing: 1px; }
.navbar ul { list-style: none; display: flex; gap: 6px; align-items: center; }
.navbar a {
    color: rgba(255,255,255,0.85); text-decoration: none;
    font-weight: 600; font-size: 0.88rem; padding: 8px 14px;
    border-radius: 8px; transition: 0.2s; letter-spacing: 0.3px;
}
.navbar a:hover, .navbar a.active { color: var(--amarillo); background: rgba(255,255,255,0.08); }
.navbar a.salir { color: #f08080; }
.navbar a.salir:hover { background: rgba(231,76,60,0.15); color: var(--rojo); }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; }
.hamburger span { width: 25px; height: 3px; background: white; border-radius: 3px; transition: 0.3s; }

/* ===== HERO SECTION (inicio) ===== */
.hero {
    background: linear-gradient(135deg, var(--azul-dark) 0%, var(--azul) 60%, #1a6fa8 100%);
    color: white; padding: 70px 5% 60px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; top: -50px; right: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(241,196,15,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute; bottom: -60px; left: -60px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(230,126,34,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-inner { position: relative; z-index: 1; max-width: 800px; }
.hero-eyebrow {
    display: inline-block; background: rgba(241,196,15,0.2);
    border: 1px solid rgba(241,196,15,0.5);
    color: var(--amarillo); padding: 5px 16px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 {
    color: white; font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2; margin-bottom: 16px;
}
.hero h1 span { color: var(--amarillo); }
.hero p {
    font-size: 1.05rem; color: rgba(255,255,255,0.85);
    max-width: 580px; margin-bottom: 30px;
}
.hero-stats {
    display: flex; gap: 30px; flex-wrap: wrap; margin-top: 20px;
}
.stat { text-align: center; }
.stat-num { font-family: 'Montserrat', sans-serif; font-size: 2rem; font-weight: 800; color: var(--amarillo); }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== CONTENT ===== */
.content { padding: 40px 5%; max-width: 1200px; margin: 0 auto; flex: 1; width: 100%; }

/* ===== CARDS ===== */
.grid-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px; margin-top: 30px;
}

.card {
    background: white; padding: 32px 28px; border-radius: 16px;
    box-shadow: var(--card-shadow); text-align: center;
    border-top: 5px solid var(--amarillo); transition: transform 0.3s, box-shadow 0.3s;
    position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 35px rgba(0,0,0,0.12); }
.card-icon { font-size: 2.8rem; margin-bottom: 14px; display: block; }
.card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.card p { color: var(--gris); font-size: 0.9rem; line-height: 1.6; }

/* ===== WELCOME CARD ===== */
.welcome-banner {
    background: linear-gradient(135deg, var(--azul-dark), var(--azul));
    border-radius: 16px; padding: 32px 36px; color: white;
    display: flex; align-items: center; gap: 24px;
    flex-wrap: wrap; margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(26,80,139,0.3);
}
.welcome-avatar {
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(241,196,15,0.2); border: 3px solid var(--amarillo);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; flex-shrink: 0;
}
.welcome-text h2 { color: white; margin-bottom: 6px; }
.welcome-text p  { color: rgba(255,255,255,0.8); font-size: 0.93rem; }

/* ===== FEATURES SECTION ===== */
.features-section { margin-top: 50px; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 { font-size: 1.7rem; margin-bottom: 10px; }
.section-header p  { color: var(--gris); max-width: 500px; margin: 0 auto; }
.section-divider {
    width: 60px; height: 4px; background: var(--amarillo);
    border-radius: 2px; margin: 12px auto 0;
}

/* ===== ABOUT / INFO BOXES ===== */
.info-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px; margin-top: 30px;
}
.info-box {
    background: white; border-radius: 14px; padding: 28px;
    box-shadow: var(--card-shadow); border-left: 5px solid var(--amarillo);
}
.info-box h3 { margin-bottom: 12px; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.info-box p  { color: var(--gris); font-size: 0.9rem; }

/* ===== COMPONENT SECTIONS (wiki) ===== */
.component-section {
    background: white; padding: 28px 30px; margin-top: 28px; border-radius: 14px;
    border-left: 7px solid var(--amarillo); box-shadow: var(--card-shadow);
}
.component-section h2 { font-size: 1.2rem; margin-bottom: 14px; }

.image-placeholder {
    width: 100%; max-width: 520px; background-color: #eef3f9;
    margin: 18px 0; border-radius: 12px; overflow: hidden;
    border: 2px solid #dde3ec; min-height: 200px;
    display: flex; align-items: center; justify-content: center;
}
.image-placeholder img { width: 100%; height: auto; object-fit: contain; display: block; }

.tag {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 600; margin: 4px 4px 4px 0;
}
.tag-red    { background: #fdecea; color: var(--rojo); }
.tag-blue   { background: #e8f0fb; color: var(--azul); }
.tag-green  { background: #e8f8ef; color: var(--verde); }

/* ===== BTN ===== */
.btn {
    display: inline-block; margin-top: 15px; padding: 11px 24px;
    background-color: var(--azul); color: white; text-decoration: none;
    border-radius: 25px; font-weight: 700; border: none; cursor: pointer;
    transition: 0.3s; font-size: 0.9rem;
}
.btn:hover { background: var(--azul-dark); transform: translateY(-1px); }
.btn-orange { background: var(--naranja); }
.btn-orange:hover { background: var(--naranja-dark); }

/* ===== FORUM ===== */
.forum-thread {
    background: white; border-radius: 14px; padding: 24px 28px;
    margin-top: 18px; box-shadow: var(--card-shadow);
    border-left: 5px solid var(--azul); transition: 0.3s;
}
.forum-thread:hover { transform: translateX(4px); }
.thread-meta { color: var(--gris); font-size: 0.82rem; margin: 6px 0 12px; }
.thread-category {
    display: inline-block; background: #e8f0fb; color: var(--azul);
    padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; margin-left: 8px;
}

/* ===== LMS CARDS ===== */
.course-card {
    background: white; padding: 28px; border-radius: 14px;
    box-shadow: var(--card-shadow); transition: 0.3s;
}
.course-card:hover { transform: translateY(-4px); }
.course-badge {
    display: inline-block; padding: 5px 14px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 14px;
}
.progress-bar-wrap { background: #eee; border-radius: 10px; height: 8px; margin: 14px 0; }
.progress-bar { height: 8px; border-radius: 10px; background: var(--verde); transition: width 0.6s; }

/* ===== FOOTER ===== */
.site-footer {
    text-align: center; padding: 24px 20px;
    background-color: var(--azul-dark); color: rgba(255,255,255,0.8);
    margin-top: auto; font-size: 0.88rem; border-top: 3px solid var(--amarillo);
}
.site-footer strong { color: var(--amarillo); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; padding: 0 4%; min-height: 60px; }
    .hamburger { display: flex; }
    .navbar ul {
        display: none; width: 100%; flex-direction: column;
        padding: 12px 0 18px; gap: 4px; border-top: 1px solid rgba(255,255,255,0.1);
    }
    .navbar ul.open { display: flex; }
    .navbar a { padding: 10px 14px; display: block; width: 100%; }

    .hero { padding: 45px 5% 40px; }
    .hero-stats { gap: 20px; }
    .stat-num { font-size: 1.6rem; }

    .welcome-banner { padding: 22px; }
    .grid-menu { grid-template-columns: 1fr; }
    .info-grid  { grid-template-columns: 1fr; }

    .content { padding: 28px 5%; }
    .component-section { padding: 20px; }
    .login-container { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .login-container { margin: 20px; }
    .hero h1 { font-size: 1.6rem; }
    .navbar h2 { font-size: 1.2rem; }
}
