/* ========================================
   PULSOPERÚ - Diseño Premium Limpio
   Portal de noticias profesional
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta Premium - Limpia y Profesional */
    --color-primary: #DC2626;
    --color-primary-dark: #B91C1C;
    --color-secondary: #111827;
    --color-accent: #F59E0B;
    --color-dark: #111827;
    --color-text: #374151;
    --color-text-secondary: #6B7280;
    --color-text-light: #9CA3AF;
    --color-border: #E5E7EB;
    --color-bg: #F9FAFB;
    --color-bg-dark: #F3F4F6;
    --color-white: #FFFFFF;
    --color-live: #10B981;
    --color-urgent: #DC2626;

    /* Categorías - Colores vibrantes pero elegantes */
    --cat-farandula: #EC4899;
    --cat-deportes: #10B981;
    --cat-policiales: #EF4444;
    --cat-politica: #3B82F6;
    --cat-economia: #8B5CF6;
    --cat-internacional: #06B6D4;

    /* Tipografía Premium */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Sombras sutiles y elegantes */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);

    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========================================
   HEADER - Diseño Premium Limpio
======================================== */
.header {
    background: var(--color-white);
    color: var(--color-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.logo h1 {
    color: var(--color-dark);
}

.logo h1 span {
    color: var(--color-primary);
}

.live-badge {
    background: var(--color-live);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-refresh {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-refresh:hover {
    background: var(--color-primary-dark);
}

.btn-refresh i {
    margin-right: 6px;
}

.search-box {
    display: flex;
    background: var(--color-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.search-box input {
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    width: 200px;
    outline: none;
    background: transparent;
}

.search-box button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--color-primary-dark);
}

/* ========================================
   NAVEGACIÓN - Diseño Premium
======================================== */
.categorias-nav {
    display: flex;
    gap: 4px;
    padding: 0;
    overflow-x: auto;
    background: var(--color-white);
    margin: 0;
    border-bottom: 1px solid var(--color-border);
}

.categorias-nav::-webkit-scrollbar {
    height: 0;
}

.categoria-btn {
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    padding: 14px 20px;
    border-radius: 0;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.categoria-btn:hover {
    color: var(--color-dark);
    background: var(--color-bg);
}

.categoria-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* Colores específicos por categoría activa - Estilo limpio */
.categoria-btn[data-categoria="farandula"].active { color: var(--cat-farandula); border-bottom-color: var(--cat-farandula); background: transparent; }
.categoria-btn[data-categoria="deportes"].active { color: var(--cat-deportes); border-bottom-color: var(--cat-deportes); background: transparent; }
.categoria-btn[data-categoria="policiales"].active { color: var(--cat-policiales); border-bottom-color: var(--cat-policiales); background: transparent; }
.categoria-btn[data-categoria="politica"].active { color: var(--cat-politica); border-bottom-color: var(--cat-politica); background: transparent; }
.categoria-btn[data-categoria="economia"].active { color: var(--cat-economia); border-bottom-color: var(--cat-economia); background: transparent; }
.categoria-btn[data-categoria="internacional"].active { color: var(--cat-internacional); border-bottom-color: var(--cat-internacional); background: transparent; }

/* ========================================
   BANNER PUBLICIDAD TOP
======================================== */
.ad-banner-top {
    background: var(--color-bg);
    padding: 12px;
    text-align: center;
}

.ad-banner-top img {
    max-width: 728px;
    width: 100%;
    height: auto;
}

.ad-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* ========================================
   BREAKING NEWS TICKER
======================================== */
.breaking-news {
    background: var(--color-urgent);
    color: white;
    padding: 8px 0;
    overflow: hidden;
}

.breaking-news-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.breaking-label {
    background: var(--color-secondary);
    color: var(--color-dark);
    padding: 4px 12px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    border-radius: 4px;
    white-space: nowrap;
}

.breaking-text {
    font-weight: 600;
    font-size: 14px;
    animation: scroll-left 20s linear infinite;
    white-space: nowrap;
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========================================
   SECCIÓN TRENDING - Lo Más Visto
======================================== */
.trending-section {
    background: linear-gradient(135deg, var(--color-dark) 0%, #2D2D2D 100%);
    padding: 30px 0;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--color-secondary);
    margin-bottom: 20px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
    padding: 20px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}

.filter-info {
    background: var(--color-white);
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.filter-info span:first-child {
    font-weight: 700;
    color: var(--color-text);
    font-size: 16px;
}

.badge {
    background: var(--color-primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

/* ========================================
   CARDS DE NOTICIAS - Estilo impactante
======================================== */
.noticias-grid {
    display: grid;
    gap: 20px;
}

.noticia-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: grid;
    grid-template-columns: 300px 1fr;
    box-shadow: var(--shadow-sm);
    border: none;
}

.noticia-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.noticia-imagen-container {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.noticia-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.noticia-card:hover .noticia-imagen {
    transform: scale(1.05);
}

.noticia-categoria-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.noticia-categoria-badge.farandula { background: var(--cat-farandula); color: white; }
.noticia-categoria-badge.deportes { background: var(--cat-deportes); color: white; }
.noticia-categoria-badge.policiales { background: var(--cat-policiales); color: white; }
.noticia-categoria-badge.politica { background: var(--cat-politica); color: white; }
.noticia-categoria-badge.economia { background: var(--cat-economia); color: white; }
.noticia-categoria-badge.internacional { background: var(--cat-internacional); color: white; }
.noticia-categoria-badge.general { background: #757575; color: white; }

.noticia-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.noticia-fuente {
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.noticia-fuente i {
    display: inline;
}

.noticia-titulo {
    font-family: var(--font-primary);
    font-size: 20px;
    color: var(--color-dark);
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-card:hover .noticia-titulo {
    color: var(--color-primary);
}

.noticia-descripcion {
    color: var(--color-text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.noticia-fecha {
    color: var(--color-text-light);
    font-size: 12px;
    font-weight: 600;
}

.noticia-fecha i {
    margin-right: 4px;
    color: var(--color-primary);
}

.noticia-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--color-text-light);
    font-weight: 600;
}

.noticia-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.noticia-stats i {
    color: var(--color-accent);
}

/* ========================================
   TRENDING CARDS - Verticales
======================================== */
.trending-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    box-shadow: var(--shadow-md);
}

.trending-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.trending-card .noticia-imagen-container {
    height: 180px;
    width: 100%;
}

.trending-card .noticia-content {
    padding: 15px;
}

.trending-card .noticia-titulo {
    font-size: 16px;
    -webkit-line-clamp: 2;
}

.trending-card .noticia-stats {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

/* Número de ranking en trending */
.trending-card::before {
    content: attr(data-rank);
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-secondary);
    color: var(--color-dark);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    z-index: 10;
}

/* ========================================
   SIDEBAR - Widgets y Publicidad
======================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.widget-header {
    background: var(--color-primary);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.widget-content {
    padding: 16px;
}

.widget h3 {
    background: var(--color-dark);
    color: #FFFFFF;
    margin: -24px -24px 16px -24px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.ad-widget {
    padding: 0;
    text-align: center;
    background: #f0f0f0;
}

.ad-widget img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-widget .ad-label {
    padding: 5px;
    background: #eee;
    font-size: 10px;
    color: #999;
}

.stats-widget {
    padding: 0;
}

.stats-widget h3 {
    margin: 0;
    padding: 12px 16px;
}

.stats-widget .widget-content {
    padding: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    align-items: center;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: 13px;
}

.stat-value {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 16px;
}

/* ========================================
   BOTONES DE COMPARTIR
======================================== */
.share-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.share-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: white;
}

.share-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.copy { background: #666; }

/* ========================================
   LOADING Y NO RESULTS
======================================== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}

.loading i {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
    color: var(--color-primary);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.no-results i {
    font-size: 50px;
    margin-bottom: 15px;
    color: var(--color-border);
}

.no-results p {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* ========================================
   FOOTER
======================================== */
.footer {
    background: var(--color-dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer h3 {
    font-family: var(--font-heading);
    color: var(--color-secondary);
    font-size: 24px;
    margin-bottom: 15px;
}

.footer h4 {
    color: var(--color-secondary);
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
}

.footer-info p {
    color: #AAA;
    line-height: 1.7;
    margin-bottom: 10px;
    font-size: 14px;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 8px;
}

.footer a {
    color: #AAA;
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer a:hover {
    color: var(--color-secondary);
}

.footer-tech p {
    color: #AAA;
    margin-bottom: 8px;
    font-size: 13px;
}

.footer-tech i {
    margin-right: 8px;
    color: var(--color-secondary);
}

.footer-legal {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: #AAA;
    font-size: 13px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #666;
    font-size: 12px;
}

/* ========================================
   AD SPACES - Espacios de publicidad
======================================== */
.ad-space {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.ad-space-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ad-space-inline {
    background: var(--color-white);
    padding: 15px;
    margin: 20px 0;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .noticia-card {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }

    .logo h1 {
        font-size: 26px;
    }

    .live-badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        font-size: 14px;
        padding: 8px 12px;
    }

    .noticia-card {
        grid-template-columns: 1fr;
    }

    .noticia-imagen-container {
        height: 180px;
    }

    .noticia-content {
        padding: 14px;
    }

    .noticia-titulo {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .noticia-descripcion {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .noticia-fuente {
        font-size: 11px;
    }

    .noticia-fecha {
        font-size: 11px;
    }

    .trending-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .trending-card .noticia-imagen-container {
        height: 120px;
    }

    .trending-card .noticia-content {
        padding: 10px;
    }

    .trending-card .noticia-titulo {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .section-title {
        font-size: 18px;
    }

    .trending-section {
        padding: 20px 0;
    }

    .categorias-nav {
        gap: 4px;
    }

    .categoria-btn {
        font-size: 12px;
        padding: 10px 12px;
    }

    .filter-info {
        padding: 10px 14px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .filter-info span:first-child {
        font-size: 14px;
    }

    .badge {
        font-size: 12px;
        padding: 4px 10px;
    }

    .main-content {
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .logo h1 {
        font-size: 22px;
    }

    .noticia-titulo {
        font-size: 15px;
    }

    .noticia-descripcion {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .noticia-imagen-container {
        height: 160px;
    }

    .trending-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .trending-card .noticia-imagen-container {
        height: 140px;
    }

    .trending-card .noticia-titulo {
        font-size: 14px;
    }

    .section-title {
        font-size: 16px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    /* Ocultar botón actualizar en móviles */
    .btn-refresh {
        display: none;
    }

    .categoria-btn {
        font-size: 11px;
        padding: 8px 10px;
    }

    .noticia-categoria-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .noticia-stats {
        font-size: 11px;
    }

    .widget h3 {
        font-size: 13px;
    }
}

/* Ocultar "Ver más" en móviles */
@media (max-width: 768px) {
    .ad-ver-mas {
        display: none !important;
    }

    /* Publicidad más pequeña en móviles */
    .ad-banner-top {
        padding: 8px;
    }

    .ad-banner-top .ad-link {
        gap: 10px !important;
        padding: 8px 12px !important;
    }

    .ad-banner-top .ad-link span {
        font-size: 12px !important;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 20px;
    }

    .section-title {
        font-size: 15px;
    }

    .noticia-titulo {
        font-size: 14px;
    }

    .categoria-btn {
        font-size: 10px;
        padding: 6px 8px;
    }
}
