/* ============================================
   GLOBAL.CSS - Literatura News
   Estilo "Atardecer Literario"
   Colores: Azul pizarra + Naranja cálido
   ============================================ */

/* ========== 1. RESET Y VARIABLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #2c3e50;
    --color-secondary: #e67e22;
    --color-secondary-dark: #d35400;
    --color-bg-light: #fdf6e3;
    --color-bg-light-2: #f0e9d8;
    --color-bg-dark: #1a252f;
    --color-bg-dark-2: #2c3e50;
    --text-dark: #34495e;
    --text-light: white;
    --border-color: #e0d5c8;
    --error-color: #e74c3c;
}

body {
    font-family: 'Inter', sans-serif;
    padding: 2rem;
    min-height: 100vh;
    background: linear-gradient(145deg, var(--color-bg-light) 0%, var(--color-bg-light-2) 100%);
}

/* ========== 2. TIPOGRAFÍA Y UTILIDADES ========== */
h1, h2, h3, .font-serif {
    font-family: 'Playfair Display', serif;
}

/* ========== 3. COMPONENTES COMUNES ========== */

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-2px);
}

/* Tarjetas */
.card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Modal común */
.modal-checkbox {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-checkbox:checked + .modal {
    display: flex;
}

.contenido-modal {
    background: white;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    border-radius: 1.5rem;
    overflow-y: auto;
    position: relative;
}

.cerrar-modal {
    position: sticky;
    top: 1rem;
    right: 1rem;
    float: right;
    background: var(--color-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    margin: 1rem;
    z-index: 10;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cerrar-modal:hover {
    background: var(--color-secondary);
}

.cuerpo-modal {
    padding: 2rem;
    clear: both;
}

.cuerpo-modal img {
    width: 100%;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.titulo-modal {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.texto-completo {
    line-height: 1.7;
    color: var(--text-dark);
    text-align: justify;
}

/* ========== 4. ESTILOS DEL CARRUSEL (index.html) ========== */
.contenedor-carrusel-principal {
    max-width: 1400px;
    margin: 0 auto;
}

.cabecera-carrusel {
    text-align: center;
    margin-bottom: 2rem;
}

.cabecera-carrusel h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -1px;
}

.cabecera-carrusel h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -1px;
}

.contenedor-carrusel {
    position: relative;
    width: 100%;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.4);
}

.pista-carrusel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pista-carrusel::-webkit-scrollbar {
    display: none;
}

.diapositiva-noticia {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    min-height: 500px;
}

.imagen-diapositiva {
    width: 100%;
    height: 500px;
    object-fit: contain;
    object-position: center;
}

.capa-diapositiva {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
    padding: 2rem;
    color: white;
}

.categoria-diapositiva {
    display: inline-block;
    background: var(--color-secondary);
    padding: 0.3rem 1.2rem;
    border-radius: 30px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.titulo-diapositiva {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.8rem;
    max-width: 70%;
}

.meta-diapositiva {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.extracto-diapositiva {
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 55%;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.boton-leer {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.boton-leer:hover {
    background: var(--color-secondary-dark);
    gap: 1rem;
    transform: scale(1.02);
}

.navegacion-botones {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.boton-nav {
    background: var(--color-primary);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boton-nav:hover {
    background: var(--color-secondary);
    transform: scale(1.05);
}

.puntos-carrusel {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.punto {
    width: 40px;
    height: 4px;
    background: #ccbfae;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.punto.activo {
    background: var(--color-secondary);
    width: 60px;
}

.controles-carrusel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.contenedor-barra-progreso {
    width: 200px;
    height: 3px;
    background: #ddd0c0;
    border-radius: 3px;
    overflow: hidden;
}

.barra-progreso-llena {
    width: 0%;
    height: 100%;
    background: var(--color-secondary);
    transition: width 0.1s linear;
}

.btn-archivo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    margin-top: 2rem;
}

.btn-archivo:hover {
    background: var(--color-secondary);
    transform: scale(1.02);
}


/* ========== 5. ESTILOS DEL ADMIN (admin.html) ========== */
body.admin-body {
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-dark-2) 100%);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: white;
}

.header h1 i {
    color: var(--color-secondary);
    margin-right: 0.5rem;
}

.btn-volver {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-volver:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
}

.form-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.form-card h2 {
    font-family: 'Playfair Display', serif;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-submit {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    background: var(--color-secondary);
    transform: scale(1.02);
}

.btn-cancelar {
    background: #999;
    margin-left: 0.5rem;
}

.btn-cancelar:hover {
    background: #777;
}

.tabla-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.tabla-card h2 {
    font-family: 'Playfair Display', serif;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tabla-noticias {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f5f0ea;
    font-weight: 600;
    color: var(--color-primary);
}

.imagen-preview {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.acciones-botones {
    display: flex;
    gap: 0.5rem;
}

.btn-editar, .btn-eliminar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-editar {
    color: var(--color-primary);
}

.btn-editar:hover {
    background: var(--color-primary)20;
    transform: scale(1.1);
}

.btn-eliminar {
    color: var(--color-secondary);
}

.btn-eliminar:hover {
    background: var(--color-secondary)20;
    transform: scale(1.1);
}

.empty-message {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.modal-confirm {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-confirm.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
}

.modal-content p {
    margin-bottom: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirmar {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
}

.btn-cancelar-modal {
    background: #ccc;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
}

small {
    color: #888;
    font-size: 0.7rem;
    margin-top: 0.2rem;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-dark-2) 100%);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-content {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.login-content h2 {
    margin: 1rem 0;
    color: var(--color-primary);
    font-family: 'Playfair Display', serif;
}

.login-content input {
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
}

.btn-login {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--color-secondary);
    transform: scale(1.02);
}

.btn-logout {
    background: var(--color-secondary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.btn-logout:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-2px);
}

.admin-content {
    display: none;
}

.admin-content.visible {
    display: block;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--color-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    z-index: 1100;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: var(--error-color);
}

/* Preview Imagen */
#previewImagen {
    margin-top: 0.5rem;
}

#preview {
    max-width: 150px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

/* Buscador Admin */
#buscadorNoticias, #filtroCategoria {
    font-family: 'Inter', sans-serif;
}

#buscadorNoticias:focus, #filtroCategoria:focus {
    outline: none;
    border-color: var(--color-secondary);
}

/* ========== 6. ESTILOS DEL ARCHIVO (archivo.html) ========== */
.archivo-container {
    max-width: 1400px;
    margin: 0 auto;
}

.archivo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.archivo-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 1rem 0 0.5rem;
}

.archivo-header p {
    color: #5a4a38;
    font-size: 1rem;
}

.btn-volver-archivo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    position: absolute;
    left: 2rem;
    top: 2rem;
}

.btn-volver-archivo:hover {
    background: var(--color-secondary);
    transform: translateX(-5px);
}

.filtros-archivo {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.buscador-archivo,
.filtro-categoria-archivo,
.orden-archivo {
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s;
}

.buscador-archivo {
    min-width: 250px;
}

.buscador-archivo:focus,
.filtro-categoria-archivo:focus,
.orden-archivo:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.contador-noticias {
    text-align: center;
    color: #5a4a38;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.grid-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.tarjeta-noticia {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: pointer;
}

.tarjeta-noticia:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.imagen-tarjeta {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
}

.contenido-tarjeta {
    padding: 1.5rem;
}

.categoria-tarjeta {
    display: inline-block;
    background: var(--color-secondary)20;
    color: var(--color-secondary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.titulo-tarjeta {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.fecha-tarjeta {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.extracto-tarjeta {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.leer-mas {
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s;
}

.tarjeta-noticia:hover .leer-mas {
    gap: 0.6rem;
}

.loading, .sin-resultados {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

.sin-resultados i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========== 7. RESPONSIVE ========== */
@media (max-width: 900px) {
    body {
        padding: 1rem;
    }
    
    .titulo-diapositiva {
        font-size: 1.5rem;
        max-width: 100%;
    }
    
    .extracto-diapositiva {
        max-width: 100%;
        font-size: 0.85rem;
    }
    
    .capa-diapositiva {
        padding: 1.5rem;
    }
    
    .imagen-diapositiva,
    .diapositiva-noticia {
        height: 400px;
        transition: opacity 0.5s ease;
    }
    
    .btn-volver-archivo {
        position: static;
        margin-bottom: 1rem;
        display: inline-flex;
    }
    
    .archivo-header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    th, td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .filtros-archivo {
        flex-direction: column;
    }
    
    .buscador-archivo,
    .filtro-categoria-archivo,
    .orden-archivo {
        width: 100%;
    }
    
    .grid-noticias {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .titulo-diapositiva {
        font-size: 1.2rem;
    }
    
    .imagen-diapositiva,
    .diapositiva-noticia {
        height: 350px;
    }
    
    .meta-diapositiva {
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    
    .boton-leer {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .punto {
        width: 30px;
    }
    
    .punto.activo {
        width: 45px;
    }
    
    .cuerpo-modal {
        padding: 1rem;
    }
    
    .titulo-modal {
        font-size: 1.3rem;
    }
}