/* ==========================================================================
   PEQUEÑA ESPAÑA - STYLES.CSS - VERSIÓN FINAL COMPLETA
   ========================================================================== */

/* ==========================================================================
   1. Global Reset & Variables
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #c41e3a;
    --primary-light: #e53e5a;
    --accent: #ffc107;
    --dark: #1a1a1a;
    --gray: #64748b;
    --light: #f8f8f8;
    --white: #ffffff;
    --success: #10b981;
    --error: #ef4444;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 5rem;

    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Courier New', monospace;

    /* Transitions */
    --transition: all 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
}

/* ==========================================================================
   2. Base Styles
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark);
    overflow-x: hidden;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. Navigation
   ========================================================================== */
nav {
    position: fixed;
    width: 100%;
    padding: 1.5rem 5%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
}

nav.scrolled {
    padding: 1rem 5%;
    box-shadow: var(--shadow-md);
}

nav.hidden {
    transform: translateY(-100%);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--dark);
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at 20% 80%, transparent 50%, rgba(255,255,255,0.1) 50.5%);
    background-size: 30px 30px;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    30% { transform: translate(3%, -15%); }
    50% { transform: translate(-5%, 10%); }
    70% { transform: translate(9%, 5%); }
    90% { transform: translate(-1%, 7%); }
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 1;
    padding: var(--space-xl);
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin-bottom: var(--space-lg);
    letter-spacing: -2px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

.hero p {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: var(--space-2xl);
    opacity: 0;
    font-weight: 300;
    transform: translateY(30px);
    animation: fadeInUp 1s ease 0.3s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-container {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease 0.6s forwards;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 2.5rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.cta-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-button.secondary:hover {
    background: white;
    color: var(--primary);
}

/* ==========================================================================
   5. Common Section Styles
   ========================================================================== */
section {
    padding: var(--space-3xl) 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: var(--space-2xl);
    font-weight: 800;
    color: var(--dark);
    position: relative;
    padding-bottom: var(--space-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* ==========================================================================
   6. Mission Section
   ========================================================================== */
.mission {
    padding: var(--space-3xl) 5%;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.mission-content {
    font-size: 1.3rem;
    line-height: 2;
    color: var(--dark);
    margin-bottom: var(--space-xl);
}

.mission-highlight {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: var(--space-xl);
}

/* ==========================================================================
   7. Posts Section
   ========================================================================== */
.posts-section {
    background: var(--light);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.post-video {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
}

.post-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.post-content {
    padding: var(--space-lg);
}

.post-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--space-sm);
}

.post-description {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.post-date {
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.no-posts {
    text-align: center;
    color: var(--gray);
    font-size: 1.2rem;
    padding: 4rem;
}

/* ==========================================================================
   8. About Section
   ========================================================================== */
.about {
    background: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    color: var(--primary);
}

.about-text p {
    color: var(--gray);
    margin-bottom: var(--space-lg);
    line-height: 1.8;
}

.experience-list {
    margin-top: var(--space-xl);
    list-style: none;
}

.experience-list li {
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    color: var(--dark);
}

.experience-list li:last-child {
    border-bottom: none;
}

.about-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.about-image:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   9. Books Section & Carousel - VERSIÓN SIMPLE
   ========================================================================== */
.books-section {
    margin-top: 2.5rem;
    padding: var(--space-xl);
    background: var(--light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.books-section h4 {
    color: var(--primary);
    margin-bottom: var(--space-sm);
    font-size: 1.5rem;
    text-align: center;
}

.books-section > p {
    color: var(--gray);
    margin-bottom: var(--space-xl);
    text-align: center;
}

/* Carrusel simple */
.books-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.carousel-container {
    position: relative;
    height: 400px;
}

.carousel-slide {
    display: none;
    padding: 2rem;
    text-align: center;
    height: 100%;
    box-sizing: border-box;
}

.carousel-slide.active {
    display: block;
}

.book-showcase {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 100%;
}

.book-cover {
    flex-shrink: 0;
    width: 120px;
}

.book-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.book-details {
    flex: 1;
    text-align: left;
}

.book-number {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.book-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

.book-description {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.book-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(196, 30, 58, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Navegación simple */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: var(--primary);
    color: white;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

/* Indicadores simples */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0,0,0,0.05);
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s ease;
}

.indicator.active {
    background: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-container {
        height: auto;
        min-height: 350px;
    }

    .book-showcase {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .book-cover {
        width: 100px;
    }

    .book-details {
        text-align: center;
    }

    .book-title {
        font-size: 1.5rem;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
    }
}

/* ==========================================================================
   10. YouTube Section
   ========================================================================== */
.youtube-section {
    background: var(--light);
}

.youtube-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.youtube-header p {
    color: var(--gray);
    font-size: 1.1rem;
    margin-top: var(--space-md);
}

.video-duration {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 25px;
    font-weight: 600;
    margin-top: var(--space-md);
}

.subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: #ff0000;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: var(--space-lg);
    transition: var(--transition);
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,0,0,0.3);
}

.video-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 56.25%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   11. Contact Section
   ========================================================================== */
.contact {
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: var(--space-lg);
    color: var(--dark);
}

.contact-info p {
    color: var(--gray);
    margin-bottom: var(--space-xl);
    line-height: 1.8;
}

.contact-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.contact-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Contact Form */
.contact-form {
    background: var(--light);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Captcha */
.captcha-group {
    background: white;
    padding: var(--space-lg);
    border-radius: 8px;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.captcha-question {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

.captcha-math {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--light);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

.captcha-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.captcha-operator {
    font-size: 1.2rem;
    color: var(--gray);
}

.captcha-input {
    width: 100px;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.captcha-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.captcha-input.error {
    border-color: var(--error);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.submit-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 30, 58, 0.3);
}

/* ==========================================================================
   12. Alert Messages
   ========================================================================== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: 8px;
    margin-bottom: var(--space-lg);
    font-weight: 500;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* ==========================================================================
   13. Footer
   ========================================================================== */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: var(--space-2xl) 5%;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

footer p {
    opacity: 0.8;
    font-size: 0.95rem;
}

/* ==========================================================================
   14. Utility Classes
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-2xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }
.mb-5 { margin-bottom: var(--space-2xl); }

/* ==========================================================================
   15. Loader
   ========================================================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-dot {
    width: 15px;
    height: 15px;
    margin: 0 5px;
    background: var(--primary);
    border-radius: 50%;
    animation: loader 1.4s ease-in-out infinite both;
}

.loader-dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes loader {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   16. Admin Styles
   ========================================================================== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    font-size: 2rem;
    color: var(--primary);
}

.logout-btn {
    background: var(--primary-light);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: #666;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Admin Sections */
.section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.posts-table,
.visits-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th,
.posts-table td,
.visits-table th,
.visits-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.posts-table th,
.visits-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #333;
}

.posts-table tr:hover,
.visits-table tr:hover {
    background: #f8f8f8;
}

.action-links {
    display: flex;
    gap: 10px;
}

.action-links a {
    color: var(--primary);
    text-decoration: none;
}

.action-links a:hover {
    text-decoration: underline;
}

/* Progress Bar */
.country-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* Buttons */
.btn {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    display: inline-block;
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: #666;
}

.btn-secondary:hover {
    background: #555;
}

/* Login Styles */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-title {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-subtitle {
    color: #666;
    margin-bottom: 30px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #666;
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary);
}

/* ==========================================================================
   17. Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
    .book-showcase {
        gap: 3rem;
    }
}

@media (max-width: 968px) {
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    /* Carousel responsive */
    .carousel-container {
        height: auto;
        min-height: 600px;
    }

    .book-showcase {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .book-cover-3d {
        max-width: 250px;
    }

    .book-cover-3d img {
        transform: rotateY(-15deg) rotateX(3deg);
    }

    .carousel-slide.active .book-cover-3d img {
        transform: rotateY(-5deg) rotateX(1deg);
    }

    .book-details {
        padding: 1rem;
    }

    .book-details .book-title {
        font-size: 2rem;
    }

    .book-tags {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: var(--space-3xl) var(--space-xl);
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        transition: right 0.3s;
    }

    .nav-links.active {
        right: 0;
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    /* Hero */
    .hero h1 {
        font-size: 2.5rem;
    }

    .cta-container {
        flex-direction: column;
        align-items: center;
    }

    /* Sections */
    section {
        padding: var(--space-2xl) 5%;
    }

    /* Carousel */
    .carousel-container {
        min-height: 550px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .carousel-nav svg {
        width: 16px;
        height: 16px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .book-showcase {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .book-cover-3d {
        max-width: 200px;
    }

    .book-details .book-title {
        font-size: 1.8rem;
    }

    .book-details .book-description {
        font-size: 1rem;
    }

    /* Admin */
    .admin-header {
        flex-direction: column;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        margin: 0 -20px;
        padding: 0 20px;
    }

    /* Forms */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    /* Typography */
    .section-title {
        font-size: 1.8rem;
    }

    /* Navigation */
    nav {
        padding: var(--space-md) 5%;
    }

    nav.scrolled {
        padding: 0.8rem 5%;
    }

    /* Sections */
    section {
        padding: var(--space-xl) 5%;
    }

    /* Carousel */
    .carousel-container {
        min-height: 500px;
        border-radius: 12px;
    }

    .book-showcase {
        padding: 1rem;
        gap: 1rem;
    }

    .book-cover-3d {
        max-width: 180px;
    }

    .book-details .book-title {
        font-size: 1.6rem;
    }

    .carousel-nav {
        width: 36px;
        height: 36px;
    }

    .carousel-nav svg {
        width: 14px;
        height: 14px;
    }

    .indicator {
        width: 10px;
        height: 10px;
    }

    .indicator.active::before {
        width: 4px;
        height: 4px;
    }

    /* Books */
    .books-section {
        padding: var(--space-lg);
    }

    /* Footer */
    .social-links {
        gap: var(--space-md);
    }

    .social-links a {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   18. Accessibility
   ========================================================================== */
/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles */
:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.carousel-nav:focus,
.indicator:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .carousel-track,
    .carousel-slide,
    .book-cover-3d img,
    .carousel-nav,
    .indicator,
    .tag {
        transition: none !important;
        animation: none !important;
    }

    .carousel-slide.active .book-details {
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #d40000;
        --gray: #333333;
    }
}

/* ==========================================================================
   19. Print Styles
   ========================================================================== */
@media print {
    /* Hide non-essential elements */
    nav,
    .menu-toggle,
    .loader,
    .cta-button,
    .social-links,
    .contact-form,
    .admin-header,
    .action-links,
    .carousel-nav,
    .carousel-indicators,
    footer {
        display: none !important;
    }

    /* Reset backgrounds */
    body {
        background: white;
        color: black;
    }

    section {
        page-break-inside: avoid;
        background: white !important;
    }

    /* Expand content */
    .book-description {
        -webkit-line-clamp: unset !important;
    }

    .hero {
        min-height: auto;
        background: none;
        color: black;
    }

    /* Links */
    a {
        color: black;
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ==========================================================================
   20. Estados de carga para el carrusel
   ========================================================================== */
.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    color: var(--gray);
    font-size: 1.1rem;
}

.carousel-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   21. Dark Mode (Opcional)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* ==========================================================================
   END OF STYLES.CSS
   ========================================================================== */
