/* ========================================
   TATIN - POSTS PAGE
   Estilos para el listado de posts
   ======================================== */

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 200px);
}

/* ==================== HEADER DE LA PÁGINA ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(245, 248, 255, 0.9) 100%);
    border-radius: 20px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 220, 255, 0.6);
}

.page-header-content {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2196F3;
    margin-bottom: 8px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.page-subtitle {
    color: #7F8C8D;
    font-size: 1rem;
}

.btn-crear-post {
    padding: 12px 24px;
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(76, 175, 80, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.btn-crear-post:hover {
    background: linear-gradient(180deg, #66BB6A 0%, #4CAF50 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 6px 18px rgba(76, 175, 80, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ==================== FILTROS ==================== */
.filters-container {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(245, 248, 255, 0.9) 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 220, 255, 0.6);
}

/* Búsqueda */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(150, 180, 220, 0.6);
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 255, 0.95) 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1rem;
    color: #2C3E50;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.08),
        0 0 0 3px rgba(33, 150, 243, 0.15);
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(180deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    white-space: nowrap;
}

.search-btn:hover {
    background: linear-gradient(180deg, #42A5F5 0%, #2196F3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.5);
}

/* Filtros */
.filters-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.filter-label {
    font-weight: 600;
    color: #2C3E50;
    font-size: 0.9rem;
}

.filter-select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(150, 180, 220, 0.6);
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 255, 0.95) 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    font-family: inherit;
    font-size: 0.95rem;
    color: #2C3E50;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.btn-clear-filters {
    padding: 10px 20px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 245, 255, 0.9) 100%);
    border: 1px solid rgba(200, 220, 255, 0.6);
    border-radius: 10px;
    color: #F44336;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear-filters:hover {
    background: linear-gradient(180deg, #E57373 0%, #F44336 100%);
    color: white;
    transform: translateY(-2px);
}

/* ==================== INFO DE RESULTADOS ==================== */
.results-info {
    padding: 15px 20px;
    background: linear-gradient(90deg,
        rgba(33, 150, 243, 0.1) 0%,
        rgba(33, 150, 243, 0.05) 100%);
    border-left: 4px solid #2196F3;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
    color: #2C3E50;
}

/* ==================== GRID DE POSTS ==================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Card de post */
.post-card {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(245, 248, 255, 0.95) 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 220, 255, 0.6);
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.post-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-thumbnail-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-content {
    padding: 20px;
}

.post-category {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    color: #7F8C8D;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(150, 180, 220, 0.3);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.author-name {
    font-weight: 600;
    color: #2196F3;
    font-size: 0.9rem;
}

.post-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #7F8C8D;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-footer {
    padding: 0 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #95A5A6;
}

.post-time {
    font-style: italic;
}

/* ==================== LOADING ==================== */
.loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.2rem;
    color: #7F8C8D;
    margin-bottom: 30px;
}

.empty-state-action {
    padding: 12px 24px;
    background: linear-gradient(180deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(33, 150, 243, 0.4);
}

/* ==================== PAGINACIÓN ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.pagination-btn {
    padding: 10px 20px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 245, 255, 0.9) 100%);
    border: 1px solid rgba(200, 220, 255, 0.6);
    border-radius: 10px;
    color: #2196F3;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #2196F3 0%, #1976D2 100%);
    color: white;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-weight: 600;
    color: #2C3E50;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 20px 15px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .btn-crear-post {
        width: 100%;
    }

    .filters-container {
        padding: 20px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .btn-clear-filters {
        width: 100%;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-stats {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.3rem;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .pagination-btn {
        width: 100%;
    }
}