:root {
    --primary: #0B2FE6;
    --secondary: #018339;
    --accent: #E6BE43;
    --bg-body: #FAFAFA;
    --text-main: #1A1A1A;
    --text-muted: #666666;
    --card-bg: #FFFFFF;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.12);
    --easing: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
    font-family: var(--font-main);
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Compact Search Bar for Detail Page */
.search-bar-section-compact {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

.search-bar-container-compact {
    max-width: 700px;
    margin: 0 auto;
}

.search-form-compact {
    width: 100%;
}

.search-input-wrapper-compact {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s var(--easing);
}

.search-input-wrapper-compact:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.search-input-wrapper-compact:focus-within {
    box-shadow: 0 0 0 3px rgba(1, 131, 57, 0.1);
}

.search-icon-compact {
    position: absolute;
    left: 20px;
    color: var(--secondary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.search-input-compact {
    flex: 1;
    border: none;
    padding: 12px 120px 12px 50px;
    font-size: 0.95rem;
    border-radius: 50px;
    outline: none;
    background: transparent;
    color: var(--text-main);
}

.search-input-compact::placeholder {
    color: var(--text-muted);
}

.search-btn-compact {
    position: absolute;
    right: 4px;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--easing);
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-btn-compact:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.search-btn-compact:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .search-bar-section-compact {
        padding: 15px 0;
    }

    .search-input-compact {
        padding: 10px 100px 10px 45px;
        font-size: 0.9rem;
    }

    .search-btn-compact {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .search-icon-compact {
        left: 15px;
        font-size: 0.9rem;
    }
}

.material-container {
    margin-top: 60px;
    margin-bottom: 80px;
    max-width: 1140px;
}

/* Cover Section - Card Style */
.cover-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: sticky;
    top: 40px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-md);
    transition: transform 0.4s var(--easing), box-shadow 0.4s var(--easing);
    animation: fadeInLeft 0.8s var(--easing) backwards;
}

.cover-section:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.book-cover {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s var(--easing);
    margin-bottom: 24px;
}

.book-cover:hover {
    transform: scale(1.02);
}

/* Availability Card */
.availability-card {
    background: #F5F5F5;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.bg-success {
    background-color: rgba(1, 131, 57, 0.1) !important;
    color: var(--secondary) !important;
}

.bg-danger {
    background-color: rgba(230, 190, 67, 0.15) !important;
    color: #D93025 !important;
}

.availability-info {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 500;
}

.reserve-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 100px;
    transition: all 0.2s var(--easing);
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
}

.reserve-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 8px 20px rgba(11, 47, 230, 0.2);
}

/* Details Section - Notion Style */
.details-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s var(--easing);
}

.details-card:hover {
    box-shadow: var(--shadow-lg);
}

.details-section {
    animation: fadeInRight 0.8s var(--easing) backwards;
    animation-delay: 0.1s;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(11, 47, 230, 0.08);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.material-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.material-author {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
}

/* Tabs - Linear Style */
.nav-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    padding: 12px 24px;
    transition: all 0.2s var(--easing);
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.nav-tabs .nav-link:hover {
    color: var(--text-main);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: transparent;
}

.tab-content {
    background: transparent;
    padding: 0;
}

.summary-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    font-weight: 400;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    min-width: 200px;
}

.detail-label i {
    margin-right: 12px;
    color: var(--accent);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.detail-value {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    text-align: right;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 50%;
    background: #018339;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s var(--easing);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    color: white;
}

.back-btn:active {
    transform: translateY(0);
}

.alert-custom {
    background: rgba(230, 190, 67, 0.15);
    border: none;
    border-radius: var(--radius-sm);
    padding: 16px;
    color: #856404;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
footer {
    background: #1A1A1A;
    color: white;
}

/* Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sección de Materiales Relacionados */
.related-materials-section {
    background: var(--card-bg);
    padding: 80px 0;
    margin-top: 80px;
    border-top: 4px solid #f2f2f2;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.04);
    position: relative;
}

.related-materials-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #f2f2f2 20%, #f2f2f2 50%, #f2f2f2 80%, transparent 100%);
}

.related-materials-header {
    text-align: left;
    margin-bottom: 48px;
    animation: fadeInUp 0.8s var(--easing) backwards;
}

.related-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    letter-spacing: -0.02em;
}

.related-title i {
    color: var(--accent);
}

.related-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0;
}

.related-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--easing);
    border: 1px solid rgba(0, 0, 0, 0.04);
    text-decoration: none;
    height: 100%;
}

.related-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(11, 47, 230, 0.1);
}

.related-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #F5F5F5;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--easing);
}

.related-card:hover .related-card-image img {
    transform: scale(1.05);
}

.related-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 47, 230, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s var(--easing);
}

.related-card:hover .related-card-overlay {
    opacity: 1;
}

.related-card-overlay i {
    color: white;
    font-size: 2.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.related-card-body {
    padding: 20px;
}

.related-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6rem;
}

.related-card-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.availability-badge-small {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .material-title {
        font-size: 2rem;
    }

    .material-author {
        font-size: 1.2rem;
    }

    .related-card-image {
        height: 220px;
    }

    .back-btn {
        width: 100%;
    }

    .related-materials-section {
        padding: 60px 0;
        margin-top: 60px;
    }

    .related-title {
        font-size: 1.8rem;
    }

    .related-subtitle {
        font-size: 1rem;
    }

    .related-materials-header {
        margin-bottom: 32px;
    }
}

/* Unificación de Botones - Estilo Navbar */
.btn-show {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px 32px;
    font-size: .90rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

/* Ajuste específico para el botón primario si se usa la clase combinada */
.btn-show.btn-show1 {
    background: #018339 !important;
    box-shadow: 0 3px 8px #018339 !important;
    color: #FFFFFF;
}

.btn-show.btn-show1:hover {
    background: #0B2FE6 !important;
    box-shadow: 0 4px 12px #0B2FE6 !important;
    color: #FFFFFF;
}

.btn-show.btn-show2 {
    background: #E6BE43 !important;
    box-shadow: 0 4px 12px #E6BE43 !important;
    color: #333333;
}

.btn-show.btn-show2:hover {
    background: #018339 !important;
    box-shadow: 0 3px 8px #018339 !important;
    color: #FFFFFF;
}

/* ========================================
   SIMPLE FOOTER WITH SOCIAL MEDIA
   ======================================== */
.simple-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, #018339 0%, #0B2FE6 100%);
    border-image-slice: 1;

    padding: 0 90px;
}

.simple-footer p {
    color: #e2e8f0;
    font-size: 0.95rem;
}

/* Social Media Links */
.social-links {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.social-link {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-size: 0.78rem;
    background: #018339;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(1, 131, 57, 0.3);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0B2FE6 0%, #018339 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(11, 47, 230, 0.5);
}

.social-link i {
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .simple-footer {
        margin-top: 40px;
    }

    .social-links {
        justify-content: center;
    }

    .social-link {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .simple-footer p {
        font-size: 0.9rem;
    }
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: #0B2FE6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 8px 25px rgba(11, 47, 230, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background: #018339;
    box-shadow: 0 12px 35px rgba(1, 131, 57, 0.5);
    transform: translateY(-5px) scale(1.1);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

.back-to-top i {
    animation: arrowBounce 2s ease-in-out infinite;
}

@keyframes arrowBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .back-to-top {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 1rem;
    }
}