/*
Theme Name: WpWarez Premium
Theme URI: https://github.com/antigravity/wpwarez
Author: Wp-Warez
Description: Un tema de WordPress premium, ultra moderno e interactivo diseñado para comunidades, foros y aportes de descargas.
Version: 1.0.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wpwarez
*/

/* ==========================================
   VARIABLES Y DISEÑO GLOBAL (CSS Custom Props)
   ========================================== */
:root {
    --bg-body: #eef3f7;
    --bg-card: #ffffff;
    --bg-hover: #f5f8fa;
    --border-color: #e1e8ed;
    --text-dark: #2c3e50;
    --text-medium: #546e7a;
    --text-light: #90a4ae;
    --primary: #1e293b;
    --primary-hover: #0f172a;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --shadow-card: 0 4px 20px rgba(144, 164, 174, 0.12);
    --shadow-hover: 0 6px 24px rgba(144, 164, 174, 0.2);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* Contenedor Principal */
.app-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px;
    flex-grow: 1;
}

/* ==========================================
   HEADER
   ========================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-box {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--primary);
}

.logo-container:hover .logo-box {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-hover);
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Panel de Usuario */
.user-panel {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow: var(--shadow-card);
    gap: 8px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    position: relative;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.icon-btn .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid #fff;
}

.divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.user-profile:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.user-avatar-svg {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.dropdown-arrow {
    color: var(--text-light);
    font-size: 12px;
}

/* ==========================================
   BARRA DE ACCIONES Y NOTICIAS
   ========================================== */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.news-banner {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    font-size: 14px;
    flex-grow: 1;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-tag {
    font-weight: 700;
    color: var(--accent-red);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.search-container {
    position: relative;
    width: 320px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px 12px 42px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    outline: none;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* ==========================================
   NAVEGACIÓN Y TABS
   ========================================== */
.nav-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
}

.tabs-container {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
    scrollbar-width: none; /* Ocultar barra en Firefox */
    -ms-overflow-style: none; /* Ocultar en IE/Edge */
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
    margin-right: 16px;
}

.tabs-container::-webkit-scrollbar {
    display: none; /* Ocultar barra en Chrome/Safari/Webkit */
}

.tab-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* Evitar que se aplasten si hay muchos elementos */
}

.tab-btn:hover {
    color: var(--primary);
    background: #fff;
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    border-bottom: 2px solid #fff;
    height: 48px;
    padding-bottom: 14px;
    box-shadow: 0 -4px 12px rgba(144, 164, 174, 0.05);
}

.share-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 -4px 12px rgba(30, 41, 59, 0.1);
}

.share-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ==========================================
   CONTENIDO PRINCIPAL
   ========================================== */
.main-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
    box-shadow: var(--shadow-card);
    padding: 24px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.main-card.two-columns {
    grid-template-columns: 2fr 1fr;
}

/* Estilo de Columna */
.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    max-width: 100%;
}

.col-divider {
    border-right: 1px solid var(--border-color);
    padding-right: 12px;
}

.col-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.col-title svg {
    color: var(--accent-blue);
}

/* LISTAS DE ACTIVIDAD RECIENTE */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    transition: var(--transition);
    border: 1px solid transparent;
    width: 100%;
}

.activity-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.activity-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.activity-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    flex-shrink: 0;
    font-size: 15px;
}

.activity-title {
    font-weight: 500;
    color: var(--text-dark);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
}

.activity-title:hover {
    color: var(--accent-blue);
}

.activity-author {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* LISTA DE COMENTARIOS */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.comment-item:hover {
    background: var(--bg-hover);
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    color: var(--text-medium);
    flex-shrink: 0;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.comment-user {
    font-weight: 600;
    color: var(--text-dark);
}

.comment-time {
    color: var(--text-light);
    font-size: 10px;
}

.comment-text {
    color: var(--text-medium);
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* TOP POSTS */
.top-posts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-post-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    width: 100%;
}

.top-post-item:hover {
    border-color: var(--accent-yellow);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
    transform: translateY(-1px);
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%); }
.rank-2 { background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%); }
.rank-3 { background: linear-gradient(135deg, #fed7aa 0%, #ea580c 100%); }

.top-post-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dark);
    flex-grow: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-post-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

/* ESTADISTICAS */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    background: #fff;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-medium);
    margin-top: 2px;
}

.online-dot {
    width: 7px;
    height: 7px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* CATEGORIAS */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 232px; /* Límite para mostrar exactamente 6 elementos */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.25) transparent; /* Scrollbar azul personalizada en Firefox */
    padding-right: 4px;
}

/* Custom premium scrollbar para navegadores Webkit (Chrome, Safari, Edge) */
.categories-list::-webkit-scrollbar {
    width: 4px;
}

.categories-list::-webkit-scrollbar-track {
    background: transparent;
}

.categories-list::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    transition: var(--transition);
}

.categories-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.cat-item {
    display: flex;
    flex-direction: column;
}

.cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.cat-header:hover {
    background: var(--bg-hover);
}

.cat-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-icon {
    color: var(--text-medium);
    display: flex;
    align-items: center;
}

.cat-count {
    font-size: 10px;
    color: var(--text-light);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.sub-categories {
    margin-left: 28px;
    border-left: 1px dashed var(--border-color);
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
    margin-bottom: 6px;
}

.sub-cat-item {
    font-size: 12px;
    color: var(--text-medium);
    padding: 5px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-cat-item:hover {
    background: var(--bg-hover);
    color: var(--accent-blue);
}

/* PAGINACIÓN */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    grid-column: 1 / span 3;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.page-link, .pagination-container a, .pagination-container span.page-numbers {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    background: #fff;
    transition: var(--transition);
}

.page-link:hover, .pagination-container a:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: var(--bg-hover);
}

.page-link.active, .pagination-container span.current {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.page-dots {
    color: var(--text-light);
    font-size: 14px;
}

.seo-breadcrumbs {
    margin-bottom: 20px;
    font-size: 12.5px;
    color: var(--text-medium);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.seo-breadcrumbs a {
    transition: var(--transition);
}

.seo-breadcrumbs a:hover {
    color: var(--accent-blue) !important;
}

/* ==========================================
   VISTA DE POST INDIVIDUAL (SINGLE.PHP)
   ========================================== */
.single-post-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 30px;
    margin-bottom: 30px;
}

.single-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.single-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12.5px;
    color: var(--text-medium);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.single-content {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 30px;
}

.single-content p {
    margin-bottom: 16px;
}

.single-content h2, .single-content h3 {
    color: var(--primary);
    margin: 24px 0 12px 0;
    font-weight: 700;
}

/* Estilo para links de descarga / Botones en Single */
.download-box {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.download-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-blue);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transition: var(--transition);
}

.download-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

/* BOTONES DE TORRENT Y MAGNET VERDES EXCLUSIVOS */
.torrent-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.torrent-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

.magnet-btn {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.3) !important;
    border: 1px solid rgba(52, 211, 153, 0.2) !important;
}

.magnet-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.5) !important;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background: var(--primary);
    color: #94a3b8;
    padding: 20px 0;
    font-size: 12.5px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 16px;
    list-style: none;
}

.footer-links a:hover {
    color: #fff;
}

.copyright span {
    color: #fff;
    font-weight: 600;
}

.back-to-top {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #fff;
}

/* ==========================================
   RESPONSIVO (MEDIA QUERIES)
   ========================================== */
@media (max-width: 1024px) {
    .main-card,
    .main-card.two-columns {
        grid-template-columns: 1.2fr 1fr;
    }
    .main-card > .column:last-child {
        grid-column: 1 / span 2;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
    }
    .header-actions {
        display: none !important;
    }
    .user-panel {
        width: 100%;
        justify-content: space-between;
    }
    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .news-banner {
        max-width: 100%;
    }
    .search-container {
        width: 100%;
    }
    .nav-section {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tabs-container {
        width: 100%;
        margin-right: 0 !important;
    }
    .tab-btn {
        flex-grow: 1;
        justify-content: center;
    }
    .share-btn {
        border-radius: 10px;
        justify-content: center;
    }
    .main-card,
    .main-card.two-columns {
        grid-template-columns: minmax(0, 100%) !important;
        padding: 16px;
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    .main-card > .column {
        grid-column: 1 / span 1 !important;
        border-right: none !important;
        padding-right: 0 !important;
        overflow-x: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    /* Separador estético premium en móvil entre contenido principal y barra lateral */
    .main-card > .column.col-divider {
        border-right: none !important;
        border-bottom: 2px dashed var(--border-color) !important;
        padding-bottom: 30px !important;
        margin-bottom: 20px !important;
    }
    .comments-area {
        padding: 20px 16px !important;
        margin-top: 20px !important;
    }
}

/* ==========================================
   ⭐ POST RATING INTERACTIVE SYSTEM
   ========================================== */
.stars-wrapper:not(.already-rated) .star-item:hover,
.stars-wrapper:not(.already-rated) .star-item:hover ~ .star-item {
    color: #ffb703 !important; /* Elegant gold hover */
    text-shadow: 0 0 8px rgba(255, 183, 3, 0.45);
    transform: scale(1.15);
}

.stars-wrapper:not(.already-rated) .star-item:active {
    transform: scale(0.95);
}

/* ==========================================
   🌙 MODO OSCURO SISTEMA PREMIUM
   ========================================== */
body {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.main-card, .widget, .news-banner, .tabs-container, .tab-btn, .comment-item, 
.activity-item, .top-post-item, .single-post-card, .rating-box, .download-box,
header, .user-panel, .search-input {
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode {
    --bg-body: #0b0f19;       /* Deep slate-black */
    --bg-card: #161f30;       /* Medium dark slate */
    --bg-hover: #222f47;      /* Lighter hover slate */
    --border-color: #222f47;
    --text-dark: #f8fafc;     /* White/Light text */
    --text-medium: #cbd5e1;   /* Muted gray text */
    --text-light: #64748b;    /* Darker gray text */
    --primary: #f8fafc;       /* Mantenemos textos primarios en blanco */
    --primary-hover: #ffffff;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.55);
    background: linear-gradient(135deg, #0b0f19 0%, #030712 100%) !important;
}

/* Forzar fondos semánticos en modo oscuro */
body.dark-mode .user-panel,
body.dark-mode .news-banner,
body.dark-mode .search-input,
body.dark-mode .tab-btn.active,
body.dark-mode .main-card,
body.dark-mode .single-post-card,
body.dark-mode .widget,
body.dark-mode .page-link,
body.dark-mode .pagination-container a,
body.dark-mode .pagination-container span.page-numbers,
body.dark-mode .seo-breadcrumbs {
    background: var(--bg-card) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}

/* Correcciones de elementos oscuros en Modo Oscuro */
body.dark-mode .tab-btn:hover {
    background: var(--bg-hover) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .tab-btn.active {
    border-bottom-color: var(--bg-card) !important;
}

body.dark-mode .top-post-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .top-post-item:hover {
    background: var(--bg-hover) !important;
    border-color: var(--accent-yellow) !important;
}

/* Caja destacados de selección manual o vacío */
body.dark-mode .top-posts-list div[style*="border-style: dashed"],
body.dark-mode .top-posts-list .top-post-item[style*="border-style: dashed"] {
    background: rgba(16, 185, 129, 0.04) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

/* Tarjetas de estadísticas */
body.dark-mode .stat-card {
    background: var(--bg-hover) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .stat-card:hover {
    background: var(--bg-card) !important;
    border-color: var(--accent-blue) !important;
}

body.dark-mode .stat-value {
    color: var(--text-dark) !important;
}

body.dark-mode .stat-label {
    color: var(--text-medium) !important;
}

/* Contador de categorías y autor */
body.dark-mode .cat-count,
body.dark-mode .activity-author {
    background: var(--bg-hover) !important;
    color: var(--text-dark) !important;
}

body.dark-mode .logo-text,
body.dark-mode .tab-btn,
body.dark-mode .single-title,
body.dark-mode .comment-user,
body.dark-mode .activity-title,
body.dark-mode .widget-title,
body.dark-mode .top-post-title,
body.dark-mode .col-title {
    color: var(--text-dark) !important;
}

body.dark-mode .decor-circle {
    opacity: 0.05 !important;
}

body.dark-mode input,
body.dark-mode textarea {
    background-color: var(--bg-hover) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}

/* Botón del Modo Oscuro */
.dark-mode-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 0;
}

.dark-mode-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body.dark-mode .dark-icon {
    display: none;
}

body.dark-mode .light-icon {
    display: block !important;
    color: var(--accent-yellow);
}

/* ==========================================
   🔍 BUSCADOR PREDICTIVO EN VIVO (AJAX)
   ========================================== */
.search-container {
    position: relative; /* Clave para posicionamiento absoluto */
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 999;
    max-height: 350px;
    overflow-y: auto;
    padding: 8px 0;
    transition: var(--transition);
    text-align: left;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    text-decoration: none !important;
    color: var(--text-dark) !important;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover) !important;
}

.search-result-icon {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-radius: 6px;
    flex-shrink: 0;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    text-align: left;
}

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark);
}

.search-result-meta {
    font-size: 10px;
    color: var(--text-light) !important;
}

.search-loading, .search-no-results {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-medium);
}

/* ==========================================
   ⚠️ SISTEMA INTERACTIVO DE REPORTES
   ========================================== */
.report-link-btn:hover {
    color: var(--accent-red) !important;
    transform: scale(1.02);
}

/* ==========================================
   🌙 MODO OSCURO: CORRECCIONES DE COMENTARIOS Y FOOTER
   ========================================== */
body.dark-mode .comments-area {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .comments-area label,
body.dark-mode .comments-area h3,
body.dark-mode .comments-area .logged-in-as,
body.dark-mode .comments-area .logged-in-as a,
body.dark-mode .comments-area .no-comments {
    color: var(--text-dark) !important;
}

body.dark-mode .comments-area input,
body.dark-mode .comments-area textarea {
    background-color: var(--bg-hover) !important;
    color: var(--text-dark) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode footer {
    background: #090d16 !important;
    border-color: var(--border-color) !important;
}

body.dark-mode footer,
body.dark-mode footer a,
body.dark-mode footer span,
body.dark-mode footer .copyright,
body.dark-mode footer .copyright span,
body.dark-mode footer .back-to-top {
    color: var(--text-medium) !important;
}

body.dark-mode footer a:hover {
    color: var(--accent-blue) !important;
}

/* Estilos de botones primarios en modo oscuro */
body.dark-mode .share-btn {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

body.dark-mode .share-btn:hover {
    background: #2563eb !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3) !important;
}

/* Alineación premium del buscador en la barra de navegación en desktop */
@media (min-width: 769px) {
    .nav-section .search-container {
        align-self: flex-end;
        margin-bottom: 8px;
    }
}


