/* Reset y variables */
:root {
    --primary-color: #4008da;
    --secondary-color: #410a96;
    --dark-color: #1b1464;
    --light-color: #f4f4f4;
    --white: #ffffff;
    --gray: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --font-primary: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: #333;
    background: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Moderno */
header {
    background: var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.logo h1 a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.logo h1 a:hover {
    color: var(--primary-color);
}

.logo p {
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date {
    color: var(--gray);
    font-size: 0.9rem;
}

.admin-links {
    display: flex;
    gap: 10px;
}

.admin-links a {
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.login-btn {
    background: var(--primary-color);
    color: var(--white);
}

.login-btn:hover {
    background: #d63a54;
    transform: translateY(-2px);
}

.admin-btn {
    background: var(--success);
    color: var(--white);
}

.admin-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.logout-btn {
    background: var(--gray);
    color: var(--white);
}

.logout-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Navegación Principal */
.main-nav {
    background: var(--dark-color);
    padding: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav ul li {
    position: relative;
}

.main-nav ul li a {
    display: block;
    padding: 15px 25px;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Slider Principal */
.slider-container {
    position: relative;
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.slider {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 40px;
    color: var(--white);
}

.slide-content .category {
    display: inline-block;
    background: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.slide-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.slide-content h2 a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.slide-content h2 a:hover {
    color: var(--primary-color);
}

.slide-content .meta {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: var(--white);
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 10;
}

.slider-btn:hover {
    background: var(--primary-color);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary-color);
    width: 30px;
    border-radius: 10px;
}

/* Secciones */
.section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.section-header a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.section-header a:hover {
    color: var(--secondary-color);
}

/* Grid de noticias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-image img {
    transform: scale(1.1);
}

.card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    z-index: 1;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-content h3 a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.card-content h3 a:hover {
    color: var(--primary-color);
}

.card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--gray);
}

.card-meta i {
    margin-right: 5px;
}

.card-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* Layout de 2 columnas */
.two-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--secondary-color);
}

.widget ul {
    list-style: none;
}

.widget ul li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.widget ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget ul li a {
    color: #333;
    text-decoration: none;
    transition: var(--transition);
    display: block;
}

.widget ul li a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.popular-post {
    display: flex;
    gap: 15px;
    align-items: center;
}

.popular-post img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
}

.popular-post h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.popular-post h4 a {
    color: #333;
    text-decoration: none;
}

.popular-post h4 a:hover {
    color: var(--primary-color);
}

.popular-post span {
    font-size: 0.75rem;
    color: var(--gray);
}

.category-list li a {
    display: flex;
    justify-content: space-between;
}

.category-list li a span:first-child {
    color: #333;
}

.category-list li a span:last-child {
    color: var(--primary-color);
    font-weight: bold;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-about h3,
.footer-links h3,
.footer-social h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-about p {
    color: var(--gray);
    line-height: 1.6;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    color: var(--white);
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--gray);
    font-size: 0.85rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Página de Noticia Individual */
.single-post {
    background: var(--white);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.single-post h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: var(--gray);
    font-size: 0.9rem;
}

.featured-image {
    margin: 20px 0 30px;
}

.featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 10px;
}

.post-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content h2,
.post-content h3 {
    margin: 25px 0 15px;
    color: var(--secondary-color);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 15px 25px;
    margin: 20px 0;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.share-buttons span {
    font-weight: bold;
    color: var(--secondary-color);
}

.share-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.share-facebook { background: #3b5998; }
.share-twitter { background: #1da1f2; }
.share-whatsapp { background: #25d366; }

.share-buttons a:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* No posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 10px;
}

.no-posts i {
    color: var(--gray);
    margin-bottom: 20px;
}

.no-posts p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Newsletter Widget (opcional) */
.widget-newsletter {
    background: linear-gradient(135deg, var(--secondary-color), var(--dark-color));
    color: white;
    text-align: center;
}

.widget-newsletter h3 {
    color: white;
    border-bottom-color: var(--primary-color);
}

.widget-newsletter p {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.newsletter-form button {
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #d63a54;
}

/* Efecto de fade-in para imágenes lazy load */
img[loading="lazy"], img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded, img.lazy.loaded {
    opacity: 1;
}

/* Placeholder mientras carga la imagen */
img[loading="lazy"], img.lazy {
    background: #f1f5f9;
    min-height: 100px;
}

/* Efecto de skeleton para imágenes */
.image-placeholder {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}