/* ==============================
   PLANTILLA DOUBLE - CSS PERSONALIZADO
   ============================== */

/* Variables CSS personalizables */
:root {
    --double-primary: #1a1a2e;
    --double-secondary: #16213e;
    --double-accent: #e94560;
    --double-accent-secondary: #f39c12;
    --double-bg: #f5f6fa;
    --double-text: #2c3e50;
    --double-text-light: #7f8c8d;
    --double-white: #ffffff;
    --double-dark: #212529;
    
    /* Gradientes */
    --double-gradient-primary: linear-gradient(135deg, var(--double-primary), var(--double-secondary));
    --double-gradient-accent: linear-gradient(135deg, var(--double-accent), var(--double-accent-secondary));
    
    /* Sombras */
    --double-shadow-soft: 0 2px 10px rgba(0,0,0,0.1);
    --double-shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --double-shadow-strong: 0 8px 30px rgba(0,0,0,0.2);
}

/* Estilos globales */
body {
    background-color: var(--double-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--double-text);
    line-height: 1.6;
}

/* Header/Navegación */
.navbar {
    background: var(--double-gradient-primary) !important;
    padding: 1rem 0;
    box-shadow: var(--double-shadow-medium);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--double-white) !important;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    font-size: 1.8rem;
    margin-right: 0.5rem;
    color: var(--double-accent);
}

.navbar-nav .nav-link {
    color: var(--double-white) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Layout principal */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Barra de administración */
.admin-toolbar {
    background: var(--double-gradient-accent);
    color: var(--double-white);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--double-shadow-medium);
}

.admin-toolbar .btn {
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.admin-toolbar .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--double-white);
    transform: translateY(-2px);
}

/* Grid de posts - Layout de 2 columnas */
.posts-double-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .posts-double-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .posts-double-grid.three-columns {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mejoras para layout de 2 columnas usando Bootstrap */
.posts-grid.row.g-4 {
    --bs-gutter-x: 2rem;
    --bs-gutter-y: 2rem;
}

/* Asegurar altura uniforme y flex layout en 2 columnas */
.posts-grid.row .post-card.h-100 {
    display: flex;
    flex-direction: column;
    border: none !important;
}

.posts-grid.row .post-card.h-100 .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.posts-grid.row .post-card.h-100 .card-body .text-end {
    margin-top: auto;
    padding-top: 1.5rem;
}

/* Tarjetas de posts */
.post-card {
    background: var(--double-white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--double-shadow-soft);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--double-shadow-strong);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--double-gradient-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.post-card:hover::before {
    transform: scaleX(1);
}

/* Imágenes de posts */
.post-card .card-img-top {
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .card-img-top {
    transform: scale(1.05);
}

.post-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
}

/* Badges de categorías */
.category-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}

.category-badges .badge {
    background: var(--double-gradient-accent);
    color: var(--double-white);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.category-badges .badge:hover {
    transform: scale(1.05);
    box-shadow: var(--double-shadow-medium);
}

/* Metadatos de posts */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--double-text-light);
    font-size: 0.9rem;
}

.post-meta i {
    color: var(--double-accent);
    margin-right: 0.25rem;
}

.post-meta a {
    color: var(--double-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-meta a:hover {
    color: var(--double-accent);
}

/* Títulos de posts */
.post-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.post-card .card-title a {
    color: var(--double-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card .card-title a:hover {
    color: var(--double-accent);
}

/* Excerpt de posts */
.post-card .card-text {
    color: var(--double-text-light);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Body de tarjetas */
.post-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Botones */
.btn-double-primary {
    background: var(--double-gradient-accent);
    border: none;
    color: var(--double-white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-double-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--double-shadow-medium);
    color: var(--double-white);
}

.btn-outline-double {
    border: 2px solid var(--double-accent);
    color: var(--double-accent);
    background: transparent;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-double:hover {
    background: var(--double-accent);
    color: var(--double-white);
    transform: translateY(-1px);
}

/* Sidebar */
.sidebar {
    background: var(--double-white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--double-shadow-soft);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar h5 {
    color: var(--double-text);
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--double-accent);
    display: inline-block;
}

.sidebar .widget {
    margin-bottom: 2.5rem;
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.sidebar .list-group-item {
    border: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: transparent;
}

.sidebar .list-group-item:last-child {
    border-bottom: none;
}

.sidebar .list-group-item a {
    color: var(--double-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar .list-group-item a:hover {
    color: var(--double-accent);
}

/* Paginación */
.pagination .page-link {
    border: 2px solid var(--double-accent);
    color: var(--double-accent);
    background: var(--double-white);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: var(--double-accent);
    color: var(--double-white);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: var(--double-gradient-accent);
    border-color: var(--double-accent);
    color: var(--double-white);
}

/* Footer mejorado */
footer {
    background: var(--double-gradient-primary);
    color: var(--double-white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-section h5 {
    color: var(--double-white);
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-section h5::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--double-accent);
    border-radius: 2px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-section ul li a:hover {
    color: var(--double-accent);
    padding-left: 0.5rem;
}

.footer-section ul li a i {
    margin-right: 0.5rem;
    color: var(--double-accent);
}

/* Enlaces sociales */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--double-white);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--double-accent);
    transform: translateY(-2px);
    box-shadow: var(--double-shadow-medium);
}

/* Footer inferior */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Búsqueda expandible */
.search-toggle-container {
    position: relative;
}

.search-form-expanded {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--double-white);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--double-shadow-medium);
    min-width: 300px;
    z-index: 1000;
}

.search-form-expanded input {
    border: 2px solid var(--double-accent);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.search-form-expanded input:focus {
    border-color: var(--double-accent);
    box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.25);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }

/* Estados responsive */
@media (max-width: 991.98px) {
    .posts-double-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        margin-top: 2rem;
        position: static;
    }
    
    .footer-section {
        margin-bottom: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .post-card .card-img-top {
        height: 180px;
    }
    
    .post-card .card-body {
        padding: 1rem;
    }
    
    .category-badges {
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    footer {
        padding: 2rem 0 1rem;
    }
}

/* Utilidades personalizadas */
.text-double-accent {
    color: var(--double-accent) !important;
}

.bg-double-gradient {
    background: var(--double-gradient-primary) !important;
}

.shadow-double {
    box-shadow: var(--double-shadow-medium) !important;
}

.border-double-accent {
    border-color: var(--double-accent) !important;
}

/* Efectos de carga */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
} 

.bi-arrow-up::before{
    position: relative;
    left: -7px;
}

/* ============================================
   Videos responsivos de YouTube
   ============================================ */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
    border-radius: 0.5rem;
    box-shadow: var(--double-shadow-medium);
    background: var(--double-white);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
}

.video-title {
    margin-top: 15px;
    font-weight: 700;
    color: var(--double-primary);
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.4;
}