﻿:active {
    TEXT-DECORATION: none
}

:link {
    TEXT-DECORATION: none
}

:visited {
    TEXT-DECORATION: none
}

:hover {
    TEXT-DECORATION: none
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    min-height: 100vh;
    padding: 0.8rem;
}

:root {
    --primary: #6366f1;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --dark: #0f172a;
    --light: #f8fafc;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Background Animado */
.bg-animation {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%), radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
}

.bg-animation {
    /* Cambiado de fixed a absolute para que se quede al inicio de la página */
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%), radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
}


@keyframes bgPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
}

/* Header Glassmorphism */
header {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    text-align:center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
    animation: float 6s ease-in-out infinite;
}


@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.logo-text h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 300;
}

nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

    nav a::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--primary), var(--secondary));
        transition: width 0.3s;
    }

    nav a:hover {
        color: var(--light);
    }

        nav a:hover::after {
            width: 100%;
        }

/* Main Container */
main {
    margin-top: 10px;
    padding: 2rem 5%;
    min-height: calc(100vh - 100px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 0;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(30px);
    }
}

.hero h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin: 0rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Cards Container */
.cards-container {
    background: var(--glass);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cards-container_V2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 10 auto;
}

/* Glass Card */
.glass-card {
    position: relative; /* Obligatorio */
    overflow: hidden;
    z-index: 1;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    padding: 1.5rem 1rem; /* Padding más equilibrado */
    width: 100%;
}

    .glass-card:nth-child(1) {
        animation-delay: 0.2s;
    }

    .glass-card:nth-child(2) {
        animation-delay: 0.4s;
    }

    .glass-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, transparent, rgba(255,255,255,0.05));
        opacity: 0;
        transition: opacity 0.3s;
        z-index: 0;
    }

    .glass-card:hover {
        transform: translateY(-10px) scale(1.02);
        border-color: rgba(255,255,255,0.2);
        box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    }

        .glass-card:hover::before {
            opacity: 1;
        }

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    text-align:center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.rahma-card .card-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.universal-card .card-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
}

.glass-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.glass-card p {
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.card-features {
    list-style: none;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

    .card-features li {
        padding: 0.5rem 0;
        color: #cbd5e1;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.9rem;
    }

        .card-features li::before {
            content: '→';
            color: var(--primary);
            font-weight: bold;
        }

.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

    .btn-glass::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transition: left 0.5s;
    }

    .btn-glass:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
    }

        .btn-glass:hover::before {
            left: 100%;
        }

/* Library View */
.library-view {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.library-header {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.library-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-modern {
    display: flex;
    gap: 1rem;
    flex: 1;
    max-width: 500px;
}

    .search-modern input {
        flex: 1;
        /*padding: 1rem 1.5rem;*/
        padding: 0.5rem 1rem;
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        color: var(--light);
        font-family: 'Inter', sans-serif;
        outline: none;
        transition: all 0.3s;
    }

        .search-modern input:focus {
            border-color: var(--primary);
            background: rgba(255,255,255,0.08);
        }

    .search-modern button {
        padding: 0.5rem 1rem;
        /*padding: 1rem 2rem;*/
        background: linear-gradient(135deg, var(--primary), var(--accent));
        border: none;
        border-radius: 12px;
        color: white;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.2s;
    }

        .search-modern button:hover {
            transform: scale(1.05);
        }

.back-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--light);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

    .back-btn:hover {
        background: var(--glass);
        border-color: var(--primary);
    }

/* Content Grid */
.content-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.sidebar-modern {
   /* background: var(--glass);*/
  /*  backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);*/
    /*border-radius: 20px;
    padding: 1.5rem;
    height: fit-content;
    position: relative;
    top: 0;
    z-index: 1;*/
    /* Si el sidebar es flex, esto evita que los hijos se estiren */
    /*display: flex;
    flex-direction: column;
    align-items: flex-start;*/
}

    .sidebar-modern h4 {
        font-family: 'Space Grotesk', sans-serif;
        margin-bottom: 1rem;
        color: var(--light);
        font-size: 1.1rem;
    }

    .sidebar-modern ul {
        list-style: none;
    }

    .sidebar-modern li {
        margin-bottom: 0.5rem;
    }

    .sidebar-modern a {
        display: block;
        padding: 0.8rem 1rem;
        color: #94a3b8;
        text-decoration: none;
        border-radius: 10px;
        transition: all 0.3s;
        font-size: 0.9rem;
    }

        .sidebar-modern a:hover,
        .sidebar-modern a.active {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
            color: var(--light);
            transform: translateX(5px);
        }

.books-grid {
    display: grid;
    gap: 1.5rem;
}

.book-item {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Soporte para Safari */
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s;
    cursor: pointer;
    /* Se remueve display: flex, gap y align-items para no romper Bootstrap */
    margin-left: 0;
    margin-right: 0;
}

    .book-item:hover {
        transform: translateX(10px);
        border-color: rgba(99, 102, 241, 0.3);
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    }

.book-cover {
    width: 80px;
    height: 110px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.book-content {
    flex: 1;
}

    .book-content h3 {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
        color: var(--light);
    }

.book-meta {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.book-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.btn-small {
    /* Reseteo absoluto para que midan exactamente lo mismo */
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important; /* Elimina la diferencia de relleno nativo */
    border: none !important; /* Elimina el borde nativo del button */
    /* Dimensiones idénticas */
    width: 120px !important; /* Ajusta a tu gusto */
    height: 40px !important; /* Ajusta a tu gusto */
    /* Alineación interna idéntica */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Estilos de texto heredados uniformes */
    font-family: inherit !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    /* Colores de ejemplo (cámbialos por los tuyos) */
    background-color: #6366f1;
    color: #ffffff;
    border-radius: 8px;
}

    .btn-small:hover {
        background: var(--primary);
        color: white;
    }

.btn-small2 {
    /* Reseteo de propiedades nativas del <button> */
    appearance: none;
    border: none;
    cursor: pointer;
    box-sizing: border-box; /* Crucial para que el padding no sume al tamaño */
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: 24px; /* Altura fija para garantizar igualdad */
    /* Espaciado y Texto */
    padding: 0 8px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit; /* Para que usen la misma fuente */
    font-size: 0.75rem;
    font-weight: 600;
    /* Estética */
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 4px;
    transition: all 0.3s;
    /* Alineación en contenedores Flex/Grid */
    align-self: start;
    justify-self: start;
}

    .btn-small2:hover {
        background: var(--primary);
        color: white;
    }

    /* Ajuste para los iconos de Bootstrap dentro del botón */
    .btn-small i {
        margin-right: 4px;
        line-height: 0; /* Evita que el icono empuje la altura */
    }



.btn-small_fijo {
    padding: 0.3rem 0.7rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
    width: 100%;
    max-width: 200px;
    margin-bottom: 0.5rem;
    display: block;
}

    .btn-small_fijo:hover {
        background: rgba(0,0,128);  /*var(--primary);*/
        color:  white;  /* cadetblue;*/
    }

.btn-small_Grande {
    padding: 0.6rem 1.2rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
}

    .btn-small_Grande:hover {
        background: var(--primary);
        color: white;
    }


/* Responsive */
@media (max-width: 968px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-modern {
        position: static;
    }

    nav ul {
        display: none;
    }
}

@media (max-width: 640px) {
    .cards-container {
        grid-template-columns: 1fr;
    }

    .library-header {
        flex-direction: column;
        text-align: center;
    }

    .search-modern {
        flex-direction: column;
        width: 100%;
    }

    .book-item {
        flex-direction: column;
    }
}

/* Loading Animation */
/*.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}*/

.loader {
    /* Cambiamos 'fixed' por 'relative' o 'block' */
    position: relative;
    /* Eliminamos top: 0 y left: 0 ya que no son necesarios en relativo */
    width: 100%;
    /* Ajustamos la altura para que no ocupe toda la pantalla forzosamente */
    min-height: 300px;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Bajamos el z-index ya que no necesita estar por encima de todo */
    z-index: 10;
    transition: opacity 0.5s;
}

    .loader.hidden {
        opacity: 0;
        pointer-events: none;
    }

.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animación de clic */
/*.card-loading {
    transform: scale(0.95);
    opacity: 0.6;
    filter: blur(2px);
    transition: all 0.3s ease;
    pointer-events: none;*/ /* Evita múltiples clics */
/*}*/

/* Opcional: un spinner sencillo que aparecerá al centro */
/*.loader-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: none;*/ /* Oculto por defecto */
/*}*/


/* --- ANIMACIÓN IMPACTANTE AL HACER CLIC --- */
.card-loading {
    transform: scale(0.92);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4) !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none; /* Evita clics dobles */
    position: relative; /* Obligatorio para posicionar el reloj */
    overflow: hidden; /* Mantiene el efecto dentro de los bordes redondeados */
}

    /* El reloj tecnológico de rayas perimetrales */
    .card-loading::after {
        content: '';
        position: absolute;
        inset: -20px; /* Se expande un poco hacia afuera */
        z-index: 5;
        /* Crea el patrón de rayas (efecto rejilla de reloj) */
        background: conic-gradient( from 0deg, rgba(255,255,255,0.8) 0deg 2deg, transparent 2deg 15deg );
        background-size: 100% 100%;
        /* Máscara matemática: oculta el centro para que las rayas solo se vean en los extremos */
        -webkit-mask: radial-gradient(circle, transparent 65%, black 66%);
        mask: radial-gradient(circle, transparent 65%, black 66%);
        /* Mezcla de animaciones: una gira el reloj y la otra expande las rayas */
        animation: girarReloj 0.3s linear infinite, expandirRayas 0.3s ease-out forwards;
    }

    /* Difuminado suave sobre el contenido interno (la imagen y texto) */
    .card-loading a {
        filter: blur(1.5px) grayscale(0.3);
        opacity: 0.5;
        transition: all 0.3s ease;
    }

/* --- LOGICA DE LAS ANIMACIONES --- */

/* 1. Hace girar las manecillas/rayas como un radar */
@keyframes girarReloj {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 2. Hace que las rayas del borde se agranden/empujen hacia afuera agresivamente */
@keyframes expandirRayas {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0; /* Se desvanece al final del salto de página */
    }
}
