/* blog.css - Diseño moderno con tarjetas blancas */

.blog-header {
    text-align: center;
    padding: 2rem 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,173,181,0.15) 0%, transparent 70%);
    animation: rotar 20s linear infinite;
}

@keyframes rotar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.blog-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.blog-header p {
    font-size: 0.9rem;
    opacity: 0.8;
    position: relative;
    z-index: 2;
}

/* Botón crear nota */
#admin-bar {
    text-align: center !important;
    margin: 1rem auto !important;
}

.btn-crear-nota {
    display: inline-block;
    background: linear-gradient(135deg, #00adb5, #007a7f);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,173,181,0.3);
}

.btn-crear-nota:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,173,181,0.4);
}

/* Buscador y filtros */
.blog-filters {
    padding: 1rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box input, .category-filter select {
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    background: white;
    color: #1a1a2e;
    font-size: 0.85rem;
    min-width: 200px;
}

.search-box input::placeholder {
    color: #94a3b8;
}

.search-box input:focus, .category-filter select:focus {
    outline: none;
    border-color: #00adb5;
    box-shadow: 0 0 0 2px rgba(0,173,181,0.1);
}

/* Tabs */
.blog-tabs {
    padding: 0.8rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 0.4rem 1rem;
    border: none;
    background: #f1f5f9;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #1a1a2e;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: #00adb5;
    color: white;
}

/* Grid de tarjetas */
.posts-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Tarjeta blanca */
.post-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-card:hover {
    transform: translateY(-6px);
    border-color: #00adb5;
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.15);
}

.post-imagen {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-imagen img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-excerpt {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-card .post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.5rem;
    margin-top: auto;
}

.post-category {
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    color: #0f172a;
    font-size: 0.7rem;
}

/* Badges */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    z-index: 2;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge.estado-reciente { background: #10b981; color: white; }
.badge.estado-vigente { background: #f59e0b; color: white; }
.badge.estado-desactualizando { background: #f97316; color: white; }
.badge.estado-desactualizado { background: #ef4444; color: white; }

/* Iconos admin */
.admin-icons {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.post-card:hover .admin-icons {
    opacity: 1;
}

.admin-icons button {
    background: rgba(0,0,0,0.7);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.admin-icons .edit-btn:hover { background: #00adb5; }
.admin-icons .delete-btn:hover { background: #dc2626; }

/* Paginación */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
}

.pagination {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #1a1a2e;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #00adb5;
    color: white;
    border-color: #00adb5;
}

.page-btn.active {
    background: #00adb5;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 28px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalFadeIn 0.2s ease;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h3 {
    color: #0f172a;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.modal-content p {
    color: #475569;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 0.5rem;
}

.btn-cancel {
    background: #f1f5f9;
    color: #0f172a;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 0.8rem 1.2rem;
    border-radius: 40px;
    color: white;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.toast-notification.show { transform: translateX(0); }
.toast-notification.success { background: #10b981; }
.toast-notification.error { background: #ef4444; }

/* Responsive */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .filters-container {
        flex-direction: column;
        align-items: center;
    }
    .search-box input, .category-filter select {
        width: 100%;
    }
    .blog-header h1 {
        font-size: 1.5rem;
    }
}
/* Forzar estilos del modal en blog (para que herede de estilo.css) */
.modal,
.modal * {
    font-family: inherit;
}

.modal-content {
    background: #1e293b !important;
    border-radius: 28px !important;
    border: 1px solid rgba(0,173,181,0.3) !important;
}

.modal-content h3 {
    color: white !important;
}

.modal-content p {
    color: rgba(255,255,255,0.7) !important;
}

.modal-content input {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
}

.btn-guardar {
    background: #00adb5 !important;
    color: white !important;
}

.btn-cancelar {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.toast-notification {
    background: #10b981 !important;
    color: white !important;
}