/* ============================================
   BLOG PREMIUM - DISEÑO CON GRID REAL
   ============================================ */

/* ========== HERO SECTION ========== */
.blog-hero {
    position: relative;
    padding: 6rem 0 4rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%);
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(74, 144, 164, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(134, 197, 168, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(74, 144, 164, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-600);
    max-width: 540px;
}

/* Buscador Premium */
.search-wrapper {
    position: relative;
    max-width: 580px;
    margin-bottom: 2rem;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.125rem;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 1rem 6rem 1rem 3.5rem;
    font-size: 1rem;
    border: 2px solid rgba(74, 144, 164, 0.2);
    border-radius: 16px;
    background: white;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 144, 164, 0.1), 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.search-shortcut {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.25rem;
}

.search-shortcut kbd {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: monospace;
    color: var(--gray-600);
}

/* Stats rápidas */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.stat-divider {
    width: 1px;
    height: 2.5rem;
    background: var(--gray-300);
}

/* Hero Illustration */
.hero-illustration {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: float 3s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 50%;
    right: 15%;
    animation-delay: 1s;
}

.floating-card.card-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, rgba(74, 144, 164, 0.1), rgba(74, 144, 164, 0.2));
    color: var(--primary);
}

.card-title {
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

.hero-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 144, 164, 0.05), rgba(134, 197, 168, 0.05));
    z-index: -1;
}

/* =====================================================
   LAYOUT GRID PRINCIPAL - Sistema Real de 2 Columnas
   ===================================================== */

.blog-content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: 80vh;
    background: #f8f9fa;
}

/* =====================================================
   SIDEBAR - Columna Fija con Sticky
   ===================================================== */

.blog-sidebar {
    grid-column: 1;
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bs-gray-200);
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-dark);
    margin: 0;
}

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bs-gray-200);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--bs-dark);
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: var(--bs-gray-300);
    transform: rotate(90deg);
}

/* Buscador del sidebar */
.sidebar-search {
    position: relative;
    margin-bottom: 0.5rem;
}

.sidebar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary);
    font-size: 0.875rem;
}

.sidebar-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.875rem;
    border: 1.5px solid var(--bs-gray-300);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(138, 35, 135, 0.1);
}

/* Categorías agrupadas por bloques temáticos */
.sidebar-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.category-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bs-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
    padding: 0 0.5rem;
}

.sidebar-category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.sidebar-category-item:hover {
    background: var(--bs-gray-100);
    transform: translateX(4px);
}

.sidebar-category-item.active {
    background: linear-gradient(135deg, rgba(138, 35, 135, 0.1), rgba(138, 35, 135, 0.05));
    box-shadow: 0 2px 8px rgba(138, 35, 135, 0.1);
}

.sidebar-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-category-info {
    flex: 1;
    min-width: 0;
}

.sidebar-category-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-category-count {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    margin: 0;
}

/* =====================================================
   CONTENIDO PRINCIPAL - Artículos (1fr)
   ===================================================== */

.blog-main {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.results-count {
    font-size: 0.95rem;
    color: var(--bs-secondary);
}

.results-count span {
    font-weight: 600;
    color: var(--bs-dark);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--bs-gray-100);
    color: var(--bs-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: var(--bs-gray-200);
    color: var(--bs-dark);
}

.view-btn.active {
    background: var(--bs-primary);
    color: white;
}

/* Grid de Artículos */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.article-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.article-badge {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--bs-dark);
    margin: 0;
    line-height: 1.3;
}

.article-subtitle {
    font-size: 1rem;
    color: var(--bs-secondary);
    margin: 0;
    line-height: 1.5;
}

.article-excerpt {
    font-size: 0.9375rem;
    color: var(--bs-secondary);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-gray-200);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

.article-meta i {
    font-size: 0.875rem;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bs-primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.article-link:hover {
    background: var(--bs-primary);
    transform: translateX(4px);
    color: white;
    box-shadow: 0 4px 12px rgba(138, 35, 135, 0.3);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 3rem 0;
    display: none;
}

.loading-indicator.active {
    display: block;
}

.loading-spinner {
    margin: 0 auto 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bs-gray-200);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--bs-secondary);
    font-weight: 500;
}

/* =====================================================
   BOTÓN FILTRAR MÓVIL
   ===================================================== */

.btn-filter-mobile {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(138, 35, 135, 0.3);
    cursor: pointer;
    z-index: 999;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-filter-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(138, 35, 135, 0.4);
}

.btn-filter-mobile i {
    font-size: 1rem;
}

/* =====================================================
   CTA SECTION
   ===================================================== */

.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.cta-card {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cta-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.cta-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
}

.cta-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--bs-dark);
    margin: 0;
}

.cta-text {
    font-size: 1.125rem;
    color: var(--bs-secondary);
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-cta-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
    color: white;
}

.cta-contact {
    display: flex;
    gap: 1rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bs-gray-100);
    color: var(--bs-dark);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: var(--bs-gray-200);
    transform: translateY(-2px);
    color: var(--bs-dark);
}

/* =====================================================
   COLORES DE CATEGORÍAS
   ===================================================== */

.article-icon.text-primary,
.sidebar-category-icon.text-primary {
    background: linear-gradient(135deg, rgba(74, 144, 164, 0.1), rgba(74, 144, 164, 0.2));
    color: var(--primary);
}

.article-icon.text-danger,
.sidebar-category-icon.text-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.2));
    color: #dc3545;
}

.article-icon.text-warning,
.sidebar-category-icon.text-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.2));
    color: #ffc107;
}

.article-icon.text-success,
.sidebar-category-icon.text-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.2));
    color: #198754;
}

.article-icon.text-info,
.sidebar-category-icon.text-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1), rgba(13, 202, 240, 0.2));
    color: #0dcaf0;
}

.article-icon.text-secondary,
.sidebar-category-icon.text-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.2));
    color: #6c757d;
}

.article-badge.badge-primary { background: rgba(74, 144, 164, 0.1); color: var(--primary); }
.article-badge.badge-danger { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.article-badge.badge-warning { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.article-badge.badge-success { background: rgba(25, 135, 84, 0.1); color: #198754; }
.article-badge.badge-info { background: rgba(13, 202, 240, 0.1); color: #0dcaf0; }
.article-badge.badge-secondary { background: rgba(108, 117, 125, 0.1); color: #6c757d; }

/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */

@media (max-width: 991px) {
    .blog-content-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
        gap: 0;
    }
    
    .blog-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .blog-sidebar.active {
        left: 0;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar-close {
        display: flex;
    }
    
    .btn-filter-mobile {
        display: flex;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stat-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .search-wrapper {
        max-width: 100%;
    }
    
    .search-shortcut {
        display: none;
    }
    
    .cta-card {
        padding: 2rem;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
}
