/* ====================
   Reset y Variables Generales
   ==================== */
:root {
    --color-bg: #000000;
    --color-bg-alt: #09090b; /* zinc-950 */
    --color-text: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-border: rgba(255, 255, 255, 0.1);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
  
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.relative-z {
    position: relative;
    z-index: 10;
}

/* ====================
   Navegación
   ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    height: 80px;
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 0.375rem;
    object-fit: cover;
}

.logo-text {
    font-weight: 300;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
    font-style: italic;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

.contact-link .text-code {
    display: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.contact-link:hover .text-normal {
    display: none;
}

.contact-link:hover .text-code {
    display: inline;
}

/* ====================
   Botón del Menú Móvil
   ==================== */
.menu-btn {
    display: none; /* Oculto en PC */
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 60;
}

.menu-btn span {
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

/* Comportamiento solo en Celulares */
@media (max-width: 767px) {
    .menu-btn {
        display: flex; /* Muestra las 3 rayitas en móvil */
    }

    .nav-links {
        display: none; /* Oculta los links por defecto en móvil */
        position: absolute;
        top: 80px; /* Debajo de la barra */
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--color-border);
    }

    /* Esta clase la activaremos con JavaScript */
    .nav-links.active {
        display: flex;
    }
}

/* ====================
   Sección Hero
   ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #000000, var(--color-bg-alt));
    padding-top: 5rem;
    text-align: center;
}

/* El patrón de cuadricula sutil de fondo */
.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, #000 70%, transparent 120%);
    -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, #000 70%, transparent 120%);
}

.hero-logo-wrapper {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

.hero-logo-large {
    width: 250px;
    height: 250px;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(255, 255, 255, 0.05);
}

.hero-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .hero-title { font-size: 4.5rem; }
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: 0.025em;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.divider .line {
    height: 1px;
    width: 3rem;
    background-color: rgba(255, 255, 255, 0.2);
}

.divider .dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
}

.hero-description {
    color: var(--color-text-muted);
    font-weight: 300;
    letter-spacing: 0.025em;
}

.hero-buttons {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
    }
}

.btn {
    padding: 0.75rem 2rem;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #ffffff;
    color: #000000;
    font-weight: 500;
    border: none; /* Asegurar que no tenga borde */
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: 300;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.hero-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8rem;
    background: linear-gradient(to top, #000000, transparent);
}

/* ====================
   Sección Servicios
   ==================== */
.services {
    padding: 6rem 0;
    background-color: #000000;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .section-header h2 { font-size: 3rem; }
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    font-weight: 300;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 1 / 1;
    background: linear-gradient(to bottom right, #18181b, #09090b);
    border: 1px solid var(--color-border);
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.card-bg {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.card:hover .card-bg {
    opacity: 0.5;
}

.card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000000, rgba(0,0,0,0.5), transparent);
}

.card-content {
    position: relative;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.icon {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.card-content p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 300;
}

/* Tarjeta especial: Desarrollo Web */
.card-code {
    background: linear-gradient(to bottom right, #09090b, #000000);
}

.code-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    overflow: hidden;
    line-height: 1.6;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* ====================
   Sección Contacto
   ==================== */
.contact {
    padding: 6rem 0;
    background: linear-gradient(to bottom, #000000, var(--color-bg-alt));
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    background-color: rgba(9, 9, 11, 0.5);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(9, 9, 11, 0.8);
}

.icon-wrapper {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

.contact-card:hover .icon-wrapper {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-small {
    color: rgba(255, 255, 255, 0.8);
}

.contact-card h3 {
    font-size: 1.125rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 300;
}

/* ====================
   Footer
   ==================== */
.footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    width: 100%;
}

.footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    font-weight: 300;
}

/* ====================
   Estilos específicos de Biblioteca / Admin
   ==================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #ffffff;
}

/* Botonera estilo "Interruptor / Switch" moderno y CENTRADA */
.role-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.35rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: max-content; /* Esto fuerza a que se adapte al contenido */
    margin: 0 auto 2.5rem auto; /* Esto asegura que el margin: 0 auto la centre */
}

.role-toggle .btn {
    min-width: 120px;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    font-weight: 400;
}

.role-toggle .btn-primary {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.role-toggle .btn-outline {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.5);
}

.role-toggle .btn-outline:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

/* Tarjeta elegante */
.login-card {
    background: linear-gradient(145deg, #121214, #09090b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Candado con resplandor sutil */
.lock-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem auto;
    color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Formulario minimalista */
.login-form label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.login-form input {
    width: 100%;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 0.5rem;
    padding: 0 1rem;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.login-form input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* ====================
   Estilos del Modal Elegante (Contraseña)
   ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Oculto por defecto con animación */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 90%;
    max-width: 400px;
    background: linear-gradient(145deg, #121214, #09090b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    
    /* Animación de entrada desde abajo */
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}
