:root {
    --bg-color: rgba(36, 23, 16, 0.55); 
    --card-bg: rgba(54, 36, 26, 0.55); 
    --border-color: rgba(82, 55, 40, 0.6); 
    --hover-color: rgba(68, 45, 32, 0.8); 
    --text-color: #fdfbf7; 
    --accent-color: #d4a373; 
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

body {
    background-color: #241710; 
    color: var(--text-color);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('https://cdn.phototourl.com/member/2026-10-26-7f1c129b-fd02-48cf-8149-f59dd26dff70.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(8px); 
    transform: scale(1.05); 
    z-index: -1;
    pointer-events: none;
}

header {
    background-color: var(--card-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1000; 
}

.logo-container .logo {
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(212, 163, 115, 0.5));
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem;
    border-radius: 4px;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 5px rgba(0,0,0,0.9);
}

nav a:hover {
    background-color: var(--hover-color);
    color: var(--accent-color);
}

.nav-highlight {
    border: 1px solid var(--accent-color);
    color: var(--accent-color) !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 20px !important;
}

.nav-highlight:hover {
    background-color: var(--accent-color);
    color: #241710 !important;
}

/* --- BOTÓN HAMBURGUESA --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background-color: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    gap: 5px;
    z-index: 300;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 3px;
    background-color: #241710;
    border-radius: 2px;
}

.hamburger:hover {
    transform: scale(1.05);
}

main {
    padding: 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

section { display: none; }
section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- TÍTULOS Y SUBTÍTULOS --- */
h1, h2 {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-color);
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.8rem;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px -1px 0 rgba(0,0,0,0.9), -1px 1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.9), 0 4px 8px rgba(0,0,0,0.9);
}

h1::after, h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    border-radius: 2px;
}

h3, h4 {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 3px 6px rgba(0,0,0,0.9);
}

section > p {
    text-align: center;
    color: var(--text-color); 
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: 0.5px;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6), 0 2px 4px rgba(0,0,0,0.9);
}

/* --- BOTONES Y BUSCADOR --- */
.btn {
    background-color: var(--text-color);
    color: #241710; 
    border: none;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    background-color: var(--accent-color);
    color: #241710;
    box-shadow: 0 4px 12px rgba(212, 163, 115, 0.4);
}

.btn-danger { background-color: rgba(217, 83, 79, 0.9); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.btn-danger:hover { background-color: #c9302c; }

.btn-success { background-color: rgba(92, 184, 92, 0.9); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.btn-success:hover { background-color: #449d44; }

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    margin: 0.2rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.search-container input {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: rgba(36, 23, 16, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 50px;
    font-size: 1rem;
    text-align: center;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(212, 163, 115, 0.5);
}

/* --- FILTROS LATERALES Y BIBLIOTECA --- */
.biblioteca-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar-filters {
    flex: 0 0 260px;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 20px;
}

.sidebar-filters h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.filter-dropdown {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(82, 55, 40, 0.4);
    padding-bottom: 0.5rem;
}

.filter-dropdown:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-dropdown summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--accent-color);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    padding: 0.5rem 0;
    user-select: none;
}

.filter-dropdown summary::-webkit-details-marker {
    display: none;
}

.filter-dropdown summary::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--text-color);
    transition: transform 0.3s;
}

.filter-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.filter-options label {
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.filter-options input[type="checkbox"] {
    accent-color: var(--accent-color);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

.filter-options::-webkit-scrollbar { width: 5px; }
.filter-options::-webkit-scrollbar-track { background: rgba(36, 23, 16, 0.3); border-radius: 4px; }
.filter-options::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* GRID */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.book-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

.book-card img.book-cover {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(212, 163, 115, 0.3);
}

.book-card h3 { 
    margin-bottom: 0.3rem; 
    color: var(--text-color); 
    font-size: 1.4rem; 
    text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px -1px 0 rgba(0,0,0,0.9), -1px 1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.9); 
}

.book-saga-info {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.9);
}

.genre-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.badge { 
    display: inline-block; 
    padding: 0.2rem 0.5rem; 
    background: var(--hover-color); 
    border-radius: 4px; 
    font-size: 0.75rem; 
    color: var(--text-color); 
    border: 1px solid var(--border-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- ESTILO COVER FLOW PARA EL CARRUSEL --- */
.full-width-coverflow {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: radial-gradient(circle at center, rgba(54, 36, 26, 0.7) 0%, rgba(36, 23, 16, 0.95) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3rem 0 1rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.coverflow-nav-btn {
    position: absolute;
    top: 3rem; 
    height: 380px; 
    width: 80px;
    background: transparent;
    color: rgba(253, 251, 247, 0.5);
    border: none;
    font-size: 3rem;
    cursor: pointer;
    z-index: 200;
    transition: background 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.coverflow-nav-btn:hover {
    background: rgba(82, 55, 40, 0.5);
    color: var(--accent-color);
}

.coverflow-nav-btn.prev { left: 0; }
.coverflow-nav-btn.next { right: 0; }

.coverflow-container {
    position: relative;
    width: 100%;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.coverflow-item {
    position: absolute;
    width: 220px;
    height: 330px;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease, filter 0.6s ease, z-index 0s;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9);
    cursor: pointer;
    -webkit-box-reflect: below 2px linear-gradient(transparent, transparent 80%, rgba(255,255,255,0.1));
}

.coverflow-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(82, 55, 40, 0.9);
}

.coverflow-info {
    text-align: center;
    margin-top: 2rem;
    min-height: 100px;
}

.coverflow-info h3 { 
    margin-bottom: 0.5rem; 
    color: var(--accent-color); 
    font-size: 2rem; 
    letter-spacing: 2px;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px -1px 0 rgba(0,0,0,0.9), -1px 1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.9), 0 4px 8px rgba(0,0,0,0.9);
}

.coverflow-info p { 
    color: var(--text-color); 
    margin-bottom: 1rem; 
    font-size: 1.1rem; 
    text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 5px rgba(0,0,0,0.9);
}

/* --- ANIMACIÓN SCROLL --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(10vh);
    visibility: hidden;
    transition: opacity 1s ease-out, transform 1s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
    visibility: visible;
}

/* --- ACERCA DE MÍ --- */
.about-me-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    margin: 4rem auto 2rem auto;
    gap: 4rem;
    padding: 3rem;
    background-color: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

.about-me-content {
    flex: 1;
}

.about-me-content h2 {
    text-align: left;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.about-me-content h2::after {
    left: 0;
    transform: none;
}

.about-me-content p {
    text-align: left;
    margin: 0 0 2rem 0;
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #150d08;
    border-radius: 50%;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: #150d08;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(212, 163, 115, 0.4);
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.about-me-image {
    position: relative;
    width: 320px;
    height: 320px;
    flex-shrink: 0;
}

.about-me-image::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 50%;
    z-index: 0;
}

.about-me-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    border: 6px solid rgba(54, 36, 26, 0.9);
}

/* --- OTROS ESTILOS (FORMULARIOS Y RULETA) --- */
.admin-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
}

.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--accent-color); font-weight: bold; text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.8rem; background-color: rgba(36, 23, 16, 0.7); border: 1px solid var(--border-color); color: var(--text-color); border-radius: 4px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--accent-color); box-shadow: 0 0 8px rgba(212, 163, 115, 0.5);
}
.form-group small { display: block; color: #d1c0b3; margin-top: 0.3rem; font-size: 0.8rem; text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.8); }

.selected-genres-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
    min-height: 35px;
}

.genre-chip {
    background-color: var(--accent-color);
    color: #241710;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.genre-chip .remove-chip {
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: #241710;
}
.genre-chip .remove-chip:hover { color: #fff; }

.ruleta-controls {
    max-width: 400px;
    margin: 0 auto 2rem auto;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

.ruleta-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.spin-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    background-color: var(--accent-color);
    color: #241710;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    border: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.3s ease;
}

.spin-btn:hover {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 6px 15px rgba(212, 163, 115, 0.6);
    background-color: var(--text-color);
}

.roulette-box {
    margin-top: 2rem;
    padding: 3rem 2rem;
    background: radial-gradient(circle, rgba(54, 36, 26, 0.8) 0%, rgba(36, 23, 16, 0.95) 100%);
    backdrop-filter: blur(5px);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- RULETA ANIMATION --- */
.roulette-spinner { 
    height: 120px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 100%;
}

.slot-box {
    background: rgba(36, 23, 16, 0.9);
    border: 2px solid var(--accent-color);
    padding: 1.5rem 3rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(212, 163, 115, 0.4), inset 0 0 15px rgba(0,0,0,0.8);
    overflow: hidden;
    position: relative;
    min-width: 350px;
    max-width: 80%;
    text-align: center;
}

.slot-box h3 { 
    font-size: 2.2rem; 
    color: var(--accent-color); 
    margin: 0; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px -1px 0 rgba(0,0,0,0.9), -1px 1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.9), 0 3px 6px rgba(0,0,0,0.9); 
}

.spin-text-anim {
    animation: slotSpin 0.15s linear infinite;
}

@keyframes slotSpin {
    0% { transform: translateY(-15px); opacity: 0.5; filter: blur(3px); }
    50% { transform: translateY(0); opacity: 1; filter: blur(0); }
    100% { transform: translateY(15px); opacity: 0.5; filter: blur(3px); }
}

.result-content { 
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 50px; 
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-center-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.roulette-cover {
    width: 160px;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1rem auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border-color);
}

.btn-roulette-action {
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
}

.hidden { display: none !important; }

#auth-container, .admin-controls {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

.auth-tabs, .admin-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn { 
    background-color: transparent; 
    color: #e5d7cb; 
    box-shadow: none; 
    border-bottom: 2px solid transparent; 
    border-radius: 0;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 5px rgba(0,0,0,0.9);
    font-weight: 600;
}

.tab-btn.active { 
    background-color: transparent; 
    color: var(--accent-color); 
    border-bottom: 2px solid var(--accent-color); 
    text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 5px rgba(0,0,0,0.9);
}

.profile-card {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

.profile-edit-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}
.profile-edit-section h4 { text-align: left; margin-bottom: 1rem; color: var(--accent-color); }

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pending-item {
    background: rgba(36, 23, 16, 0.8);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.pending-info h4 { margin-bottom: 0.3rem; text-align: left; text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9); }
.pending-info p { font-size: 0.9rem; color: var(--text-color); margin-bottom: 0.2rem; text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.9); }
.pending-actions { display: flex; gap: 0.5rem; }

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10000; 
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(15, 10, 7, 0.85); 
    backdrop-filter: blur(6px);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--accent-color);
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
    animation: slideDown 0.4s ease-out;
}

.close-modal {
    color: var(--text-color); position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9);
}
.close-modal:hover { color: var(--accent-color); }

.modal-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}
.modal-cover-img { width: 200px; height: 300px; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 15px rgba(0, 0, 0, 0.8); }
.modal-info { flex: 1; }
.modal-info h2 { text-align: left; margin-bottom: 0.5rem; color: var(--accent-color); text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 5px rgba(0,0,0,0.9); }
.modal-info h2::after { display: none; } 
.modal-subtitle { color: var(--accent-color); margin-bottom: 1rem; text-align: left; font-weight: normal; text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9); }
.modal-info .genre-badges { justify-content: flex-start; }

.modal-body { margin: 1.5rem 0; padding: 1.5rem; background: rgba(36, 23, 16, 0.7); border-radius: 8px; border-left: 4px solid var(--accent-color); box-shadow: inset 0 2px 8px rgba(0,0,0,0.5); }
.modal-body h3 { text-align: left; margin-bottom: 0.5rem; text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9); }

.modal-reviews-section { margin-top: 2rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
.modal-reviews-section h3 { text-align: left; margin-bottom: 1rem; text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9); }
.reviews-list { max-height: 250px; overflow-y: auto; margin-bottom: 1.5rem; padding-right: 0.5rem; }
.reviews-list::-webkit-scrollbar { width: 8px; }
.reviews-list::-webkit-scrollbar-track { background: rgba(36, 23, 16, 0.5); border-radius: 4px; }
.reviews-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.review-item { background: rgba(36, 23, 16, 0.7); padding: 1rem; border-radius: 6px; margin-bottom: 1rem; border-left: 3px solid var(--accent-color); border: 1px solid var(--border-color); box-shadow: 0 4px 8px rgba(0,0,0,0.5); }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.review-user { font-weight: bold; color: var(--accent-color); text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.9); }
.review-date { font-size: 0.8rem; color: #d1c0b3; }
.review-stars { color: var(--accent-color); font-size: 1.1rem; }
.review-text { font-size: 0.95rem; line-height: 1.4; color: var(--text-color); text-transform: none; text-align: left; text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.8); }

/* --- SPOILER SYSTEM --- */
.spoiler-toggle {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}
.spoiler-toggle label {
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: none;
    font-weight: normal;
}
.spoiler-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    box-shadow: none;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.review-text-container {
    position: relative;
    margin-top: 0.5rem;
}
.spoiler-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(36, 23, 16, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    color: var(--accent-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    transition: opacity 0.3s ease;
    border: 1px solid var(--border-color);
}
.spoiler-overlay:hover {
    background: rgba(54, 36, 26, 0.95);
    color: #fff;
}
.spoiler-overlay.revealed {
    opacity: 0;
    pointer-events: none;
}
.review-text.blurred {
    filter: blur(6px);
    user-select: none;
}
.review-text.revealed {
    filter: blur(0);
    user-select: auto;
}
.review-admin-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.review-toggle-spoiler-btn {
    background: transparent;
    color: #f0ad4e;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.review-toggle-spoiler-btn:hover { color: #eea236; }

.review-delete-btn { background: transparent; color: #d9534f; border: none; font-size: 1.1rem; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.review-delete-btn:hover { color: #c9302c; }
.no-reviews-msg { color: #d1c0b3; font-style: italic; text-align: center; padding: 1rem; }

.leave-review-box { background: rgba(36, 23, 16, 0.7); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: inset 0 2px 8px rgba(0,0,0,0.5); }
.leave-review-box h4 { margin-bottom: 1rem; text-align: left; color: var(--accent-color); text-shadow: -1px -1px 0 rgba(0,0,0,0.8), 1px -1px 0 rgba(0,0,0,0.8), -1px 1px 0 rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.9); }
.leave-review-box textarea { width: 100%; background: rgba(54, 36, 26, 0.8); color: var(--text-color); border: 1px solid var(--border-color); padding: 1rem; border-radius: 4px; margin: 1rem 0; resize: vertical; font-family: inherit; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); }

.stars { color: #555; font-size: 2rem; cursor: pointer; display: flex; justify-content: flex-start; gap: 0.5rem; }
.stars span:hover, .stars span:hover ~ span { color: var(--accent-color); text-shadow: 0 0 10px rgba(212, 163, 115, 0.5); }
.stars.rated span.active { color: var(--accent-color); text-shadow: 0 0 8px rgba(212, 163, 115, 0.4); }

/* --- RESPONSIVE MENU --- */
@media (max-width: 850px) {
    .hamburger { display: flex; }
    
    .biblioteca-layout { flex-direction: column; }
    
    .sidebar-filters { width: 100%; position: static; }

    nav {
        position: absolute;
        top: 60px;
        right: 2rem;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
        display: none; 
        z-index: 250;
    }

    nav.show-mobile {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .about-me-container {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
    }

    .about-me-content h2, .about-me-content p {
        text-align: center;
    }

    .about-me-content h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 700px) {
    .modal-header { flex-direction: column; align-items: center; text-align: center; }
    .modal-info h2, .modal-subtitle { text-align: center; }
    .modal-info .genre-badges { justify-content: center; }
    .pending-item { flex-direction: column; text-align: center; gap: 1rem; }
    
    .about-me-image {
        width: 250px;
        height: 250px;
    }
    
    .book-list-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .book-list-info {
        align-items: center;
        text-align: center;
    }
    .book-list-info h3, .book-list-info .author-text, .book-list-info .synopsis-preview {
        text-align: center;
    }
    .book-list-info .genre-badges {
        justify-content: center !important;
    }

    .btn-roulette-action {
        position: static;
        margin-top: 1.5rem;
        transform: none;
    }
}

/* --- BUSCADOR DE PORTADAS --- */
.cover-results-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(36, 23, 16, 0.3);
    border-radius: 4px;
}
.cover-results-container::-webkit-scrollbar { height: 8px; }
.cover-results-container::-webkit-scrollbar-track { background: rgba(36, 23, 16, 0.5); border-radius: 4px; }
.cover-results-container::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 4px; }

.cover-result-item {
    flex: 0 0 100px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.cover-result-item:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}
.cover-result-item img {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* --- ESTILOS DE VISTAS (LISTA/MOSAICO) Y PAGINACIÓN --- */
.main-library-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.view-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.active-view {
    background-color: var(--accent-color) !important;
    color: #241710 !important;
    box-shadow: 0 4px 12px rgba(212, 163, 115, 0.4);
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.book-list-item {
    background-color: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    gap: 1.5rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
    align-items: flex-start;
}

.book-list-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(212, 163, 115, 0.3);
}

.book-cover-list {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
}

.book-list-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.book-list-info h3 {
    text-align: left;
    margin-bottom: 0.3rem;
    font-size: 1.4rem;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px -1px 0 rgba(0,0,0,0.9), -1px 1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.9);
}

.book-list-info .author-text {
    color: #e5d7cb;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.6), 1px -1px 0 rgba(0,0,0,0.6), -1px 1px 0 rgba(0,0,0,0.6), 1px 1px 0 rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.8);
    text-align: left;
}

.book-list-info .synopsis-preview {
    color: var(--text-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.list-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    min-width: 35px;
}

.pagination-btn.active {
    background-color: var(--accent-color);
    color: #241710;
}

.pagination-dots {
    color: var(--text-color);
    font-weight: bold;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    font-weight: bold;
    animation: slideInRight 0.3s ease-out forwards;
    backdrop-filter: blur(5px);
}
.toast.success { border-left-color: #5cb85c; }
.toast.error { border-left-color: #d9534f; }
.toast.info { border-left-color: var(--accent-color); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- LOADER GLOBAL --- */
#global-loader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 10, 7, 0.85);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(212, 163, 115, 0.3);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- PERFIL: BIBLIOTECA PERSONAL --- */
.user-lists-container {
    margin-top: 3rem;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 15px rgba(0,0,0,0.6);
}
.user-lists-container h3 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}
.user-lists-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

/* --- BOTONES DE BIBLIOTECA PERSONAL (MODAL) --- */
.user-book-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    background: rgba(36, 23, 16, 0.7);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.btn-status, .btn-fav {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-status:hover, .btn-fav:hover {
    background: rgba(212, 163, 115, 0.2);
}

.btn-status.active-status {
    background: var(--accent-color);
    color: #241710;
    box-shadow: 0 0 10px rgba(212, 163, 115, 0.4);
}

.btn-fav.active-fav {
    background: #d9534f;
    border-color: #d9534f;
    color: white;
    box-shadow: 0 0 10px rgba(217, 83, 79, 0.4);
}

.action-separator {
    width: 2px;
    background: var(--border-color);
    margin: 0 5px;
}