/* Estilos base */
:root {
    --primary-color: #2dd4bf;
    --secondary-color: #0f766e;
    --background-color: #111111;
    --text-color: #f8fafc;
    --card-background: #1a1a1a;
    --card-hover: #222222;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-yellow: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Contenedor principal */
.app-container {
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    user-select: none;
    transition: background-color 0.3s ease;
    overflow-x: hidden;
}

.app-container.grid-view {
    overflow-y: auto;
    height: auto;
}

/* Contenedor de tarjetas */
.cards-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 70vh;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4rem auto 0;
    animation: fadeIn 0.3s ease;
    overflow: visible;
}

/* Tarjeta de noticia */
.news-card {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        var(--card-hover) 100%
    );
    border-radius: 2rem;
    padding: 2.5rem 3rem;
    width: calc(100% - 8rem);
    height: 100%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.news-card.prev {
    transform: translate(-95%) scale(0.85);
    opacity: 0.3;
    visibility: visible;
    filter: blur(1px);
}

.news-card.active {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
    visibility: visible;
    filter: blur(0);
}

.news-card.next {
    transform: translate(-5%) scale(0.85);
    opacity: 0.3;
    visibility: visible;
    filter: blur(1px);
}

/* Animaciones de deslizamiento */
.news-card.slide-left {
    animation: slideLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.news-card.slide-right {
    animation: slideRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideLeft {
    0% {
        transform: translate(-5%) scale(0.85);
        opacity: 0.3;
        filter: blur(1px);
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes slideRight {
    0% {
        transform: translate(-95%) scale(0.85);
        opacity: 0.3;
        filter: blur(1px);
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* Ajustes para las tarjetas adyacentes */
.news-card.prev.slide-left {
    animation: slideLeftPrev 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.news-card.next.slide-right {
    animation: slideRightNext 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideLeftPrev {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: translate(-95%) scale(0.85);
        opacity: 0.3;
        filter: blur(1px);
    }
}

@keyframes slideRightNext {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: translate(-5%) scale(0.85);
        opacity: 0.3;
        filter: blur(1px);
    }
}

/* Categoría base */
.category {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 3.5rem;
    color: currentColor;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
    width: fit-content;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-color: rgba(255, 255, 255, 0.3);
}

.category[data-category="salud"] { border-color: rgba(96, 165, 250, 0.3); }
.category[data-category="ciencia y tecnología"] { border-color: rgba(167, 139, 250, 0.3); }
.category[data-category="sociedad"] { border-color: rgba(236, 72, 153, 0.3); }
.category[data-category="global"] { border-color: rgba(251, 191, 36, 0.3); }
.category[data-category="medio ambiente"] { border-color: rgba(52, 211, 153, 0.3); }
.category[data-category="otros"] { border-color: rgba(203, 213, 225, 0.3); }

/* Contenido principal */
.news-content {
    flex: 1;
    margin-bottom: 2rem;
}

.news-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
}

.news-content p {
    font-size: 1.5rem;
    line-height: 1.5;
    color: var(--text-color);
    opacity: 0.92;
    font-weight: 300;
}

.news-content strong {
    font-size: 1.75rem;
    font-weight: 700;
    display: inline;
    color: white;
    opacity: 1;
    letter-spacing: -0.01em;
}

/* Metadatos */
.metadata {
    margin-top: auto;
    padding-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.5;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.metadata a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

.metadata a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Botones de navegación */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(1);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10;
}

.nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-50%) scale(1.1);
}

.nav-button:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.nav-button:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nav-button.prev {
    left: calc((100% - (100% - 8rem)) / 2 - 64px);
}

.nav-button.next {
    right: calc((100% - (100% - 8rem)) / 2 - 64px);
}

/* Eliminar las líneas decorativas */
.nav-button::before {
    display: none;
}

/* Categorías con colores */
.category[data-category="tecnología"] {
    color: rgba(96, 165, 250, 0.9);
}

.category[data-category="ciencia"] {
    color: rgba(167, 139, 250, 0.9);
}

.category[data-category="medio ambiente"] {
    color: rgba(52, 211, 153, 0.9);
}

.category[data-category="salud"] {
    color: rgba(244, 114, 182, 0.9);
}

.category[data-category="economía"] {
    color: rgba(251, 191, 36, 0.9);
}

.category[data-category="educación"] {
    color: rgba(129, 140, 248, 0.9);
}

.category[data-category="cultura"] {
    color: rgba(251, 113, 133, 0.9);
}

.category[data-category="deporte"] {
    color: rgba(56, 189, 248, 0.9);
}

.category[data-category="innovación"] {
    color: rgba(74, 222, 128, 0.9);
}

.category[data-category="sociedad"] {
    color: rgba(236, 72, 153, 0.9);
}

.category[data-category="política"] {
    color: rgba(234, 179, 8, 0.9);
}

.category[data-category="internacional"] {
    color: rgba(99, 102, 241, 0.9);
}

.category[data-category="investigación"] {
    color: rgba(147, 51, 234, 0.9);
}

/* Scroll personalizado con color */
.news-card::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent;
}

.news-card::-webkit-scrollbar-track {
    background: transparent;
}

.news-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.news-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
.news-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Indicador de navegación */
.swipe-indicator {
    text-align: center;
    color: var(--text-color);
    font-size: 0.75rem;
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease 0.1s backwards;
}

/* Ocultar el indicador en modo grid */
.app-container.grid-view .swipe-indicator {
    display: none;
}

.swipe-text {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.counter {
    opacity: 0.5;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .nav-button.prev {
        left: calc((100% - (100% - 2rem)) / 2 - 48px);
    }

    .nav-button.next {
        right: calc((100% - (100% - 2rem)) / 2 - 48px);
    }

    .news-card {
        padding: 2rem;
        width: calc(100% - 2rem);
    }

    .news-title {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .news-content p {
        font-size: 1.125rem;
        line-height: 1.4;
    }

    .news-content strong {
        font-size: 1.25rem;
    }

    .category {
        margin-bottom: 2rem;
        font-size: 0.7rem;
    }

    /* Ajustes específicos para la vista grid en móvil */
    .grid-container .news-title {
        font-size: 1.25rem;
    }

    .grid-container .news-content p {
        font-size: 1rem;
        line-height: 1.4;
    }

    .grid-container .category {
        margin-bottom: 1rem;
        font-size: 0.65rem;
    }

    .grid-container .metadata {
        font-size: 0.7rem;
    }
}

@media (max-width: 380px) {
    .news-card {
        padding: 1.75rem;
        width: calc(100% - 1.5rem);
    }

    .news-title {
        font-size: 1.375rem;
    }

    .news-content p {
        font-size: 1rem;
    }

    .news-content strong {
        font-size: 1.125rem;
    }
}

/* Variantes de color por categoría */
.news-card[data-category] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-card.active[data-category="tecnología"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(96, 165, 250, 0.12);
}

.news-card.active[data-category="ciencia"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(167, 139, 250, 0.12);
}

.news-card.active[data-category="medio ambiente"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(52, 211, 153, 0.12);
}

.news-card.active[data-category="salud"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(244, 114, 182, 0.12);
}

.news-card.active[data-category="economía"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(251, 191, 36, 0.12);
}

.news-card.active[data-category="educación"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(129, 140, 248, 0.12);
}

.news-card.active[data-category="cultura"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(251, 113, 133, 0.12);
}

.news-card.active[data-category="deporte"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(56, 189, 248, 0.12);
}

.news-card.active[data-category="innovación"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(74, 222, 128, 0.12);
}

.news-card.active[data-category="sociedad"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(236, 72, 153, 0.12);
}

.news-card.active[data-category="política"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(234, 179, 8, 0.12);
}

.news-card.active[data-category="internacional"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(99, 102, 241, 0.12);
}

.news-card.active[data-category="investigación"] {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(147, 51, 234, 0.12);
}

/* Eliminar los pseudo-elementos que ya no necesitamos */
.news-card[data-category]::after {
    display: none;
}

/* Variantes de color por categoría */
.news-card[data-category="tecnología"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(96, 165, 250) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(96, 165, 250, 0.1);
}

.news-card[data-category="ciencia"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(167, 139, 250) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(167, 139, 250, 0.1);
}

.news-card[data-category="medio ambiente"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(52, 211, 153) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(52, 211, 153, 0.1);
}

.news-card[data-category="salud"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(244, 114, 182) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(244, 114, 182, 0.1);
}

.news-card[data-category="economía"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(251, 191, 36) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(251, 191, 36, 0.1);
}

.news-card[data-category="educación"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(129, 140, 248) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(129, 140, 248, 0.1);
}

.news-card[data-category="cultura"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(251, 113, 133) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(251, 113, 133, 0.1);
}

.news-card[data-category="deporte"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(56, 189, 248) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(56, 189, 248, 0.1);
}

.news-card[data-category="innovación"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(74, 222, 128) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(74, 222, 128, 0.1);
}

.news-card[data-category="sociedad"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(236, 72, 153) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(236, 72, 153, 0.1);
}

.news-card[data-category="política"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(234, 179, 8) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(234, 179, 8, 0.1);
}

.news-card[data-category="internacional"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(99, 102, 241) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(99, 102, 241, 0.1);
}

.news-card[data-category="investigación"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(147, 51, 234) 8%, var(--card-hover)) 100%
    );
    border-color: rgba(147, 51, 234, 0.1);
}

/* Vista de mosaico */
.grid-view .cards-container {
    display: none;
}

.app-container.grid-view {
    display: flex;
    flex-direction: column;
}

.grid-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    min-height: calc(100vh - 300px);
    align-content: flex-start;
}

/* Header fijo con los filtros */
.categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.5rem;
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center;
    min-height: min-content;
    height: auto;
}

/* Estilos de los botones de filtro */
.filter-button {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.filter-button[data-category="salud"] { color: rgba(96, 165, 250, 0.9); }
.filter-button[data-category="ciencia y tecnología"] { color: rgba(167, 139, 250, 0.9); }
.filter-button[data-category="sociedad"] { color: rgba(236, 72, 153, 0.9); }
.filter-button[data-category="global"] { color: rgba(251, 191, 36, 0.9); }
.filter-button[data-category="medio ambiente"] { color: rgba(52, 211, 153, 0.9); }

.filter-button:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.filter-button.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: currentColor;
    border-width: 1px;
    color: white;
}

@media (max-width: 768px) {
    .categories-filter {
        padding: 0.75rem;
        gap: 0.5rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: auto;
    }

    .filter-button {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
        justify-content: center;
        text-align: center;
        white-space: normal;
        min-height: 2.25rem;
        display: flex;
        align-items: center;
        line-height: 1.1;
    }
}

@media (max-width: 380px) {
    .filter-button {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
        min-height: 2rem;
    }
}

/* Eliminar duplicados */
.app-container.grid-view {
    overflow-y: auto;
}

body {
    overflow-y: auto;
}

.grid-container .news-card {
    position: relative;
    transform: none !important;
    opacity: 1 !important;
    width: 100%;
    height: fit-content;
    left: 0;
    pointer-events: auto;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-container .news-card:hover {
    transform: translateY(-4px) !important;
    cursor: pointer;
}

.grid-container .news-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.grid-container .category {
    margin-bottom: 1.25rem;
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    letter-spacing: 0.08em;
}

.grid-container .metadata {
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    font-size: 0.75rem;
}

.grid-container .news-content p {
    font-size: 1.125rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colores de los filtros por categoría */
.filter-button[data-category="tecnología"] { color: rgba(96, 165, 250, 0.9); }
.filter-button[data-category="ciencia"] { color: rgba(167, 139, 250, 0.9); }
.filter-button[data-category="medio ambiente"] { color: rgba(52, 211, 153, 0.9); }
.filter-button[data-category="salud"] { color: rgba(244, 114, 182, 0.9); }
.filter-button[data-category="economía"] { color: rgba(251, 191, 36, 0.9); }
.filter-button[data-category="educación"] { color: rgba(129, 140, 248, 0.9); }
.filter-button[data-category="cultura"] { color: rgba(251, 113, 133, 0.9); }
.filter-button[data-category="deporte"] { color: rgba(56, 189, 248, 0.9); }
.filter-button[data-category="innovación"] { color: rgba(74, 222, 128, 0.9); }
.filter-button[data-category="sociedad"] { color: rgba(236, 72, 153, 0.9); }
.filter-button[data-category="política"] { color: rgba(234, 179, 8, 0.9); }
.filter-button[data-category="internacional"] { color: rgba(99, 102, 241, 0.9); }
.filter-button[data-category="investigación"] { color: rgba(147, 51, 234, 0.9); }
.filter-button[data-category="varios"] { color: rgba(203, 213, 225, 0.9); }

/* Botón de alternar vista */
.view-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    animation: slideIn 0.3s ease;
}

.view-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.1);
}

.view-toggle:active {
    transform: scale(0.95);
}

.view-toggle svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Colores de los filtros por categoría */
.filter-button[data-category="salud"] { color: rgba(96, 165, 250, 0.9); }
.filter-button[data-category="ciencia y tecnología"] { color: rgba(167, 139, 250, 0.9); }
.filter-button[data-category="sociedad"] { color: rgba(236, 72, 153, 0.9); }
.filter-button[data-category="global"] { color: rgba(251, 191, 36, 0.9); }
.filter-button[data-category="medio ambiente"] { color: rgba(52, 211, 153, 0.9); }
.filter-button[data-category="otros"] { color: rgba(203, 213, 225, 0.9); }

/* Variantes de color por categoría */
.news-card[data-category="salud"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(96, 165, 250) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(96, 165, 250, 0.3);
}

.news-card[data-category="ciencia y tecnología"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(167, 139, 250) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(167, 139, 250, 0.3);
}

.news-card[data-category="sociedad"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(236, 72, 153) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(236, 72, 153, 0.3);
}

.news-card[data-category="global"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(251, 191, 36) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(251, 191, 36, 0.3);
}

.news-card[data-category="medio ambiente"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(52, 211, 153) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(52, 211, 153, 0.3);
}

.news-card[data-category="otros"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(203, 213, 225) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(203, 213, 225, 0.3);
}

/* Sombras activas por categoría */
.news-card.active[data-category="salud"],
.grid-container .news-card[data-category="salud"]:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(96, 165, 250, 0.12);
}

.news-card.active[data-category="ciencia y tecnología"],
.grid-container .news-card[data-category="ciencia y tecnología"]:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(167, 139, 250, 0.12);
}

.news-card.active[data-category="sociedad"],
.grid-container .news-card[data-category="sociedad"]:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(236, 72, 153, 0.12);
}

.news-card.active[data-category="global"],
.grid-container .news-card[data-category="global"]:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(251, 191, 36, 0.12);
}

.news-card.active[data-category="medio ambiente"],
.grid-container .news-card[data-category="medio ambiente"]:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(52, 211, 153, 0.12);
}

.news-card.active[data-category="otros"],
.grid-container .news-card[data-category="otros"]:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 120px rgba(203, 213, 225, 0.12);
}

/* Contenedor scrolleable */
.grid-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

/* Colores de las categorías en las tarjetas */
.category[data-category="salud"] { color: rgba(96, 165, 250, 0.9); } /* Azul */
.category[data-category="ciencia y tecnología"] { color: rgba(167, 139, 250, 0.9); } /* Morado */
.category[data-category="sociedad"] { color: rgba(236, 72, 153, 0.9); } /* Rosa */
.category[data-category="global"] { color: rgba(251, 191, 36, 0.9); } /* Amarillo */
.category[data-category="medio ambiente"] { color: rgba(52, 211, 153, 0.9); } /* Verde */
.category[data-category="otros"] { color: rgba(203, 213, 225, 0.9); } /* Gris */

/* Eliminar todos los selectores antiguos de categorías */
.category[data-category="tecnología"],
.category[data-category="ciencia"],
.category[data-category="economía"],
.category[data-category="educación"],
.category[data-category="cultura"],
.category[data-category="deporte"],
.category[data-category="innovación"],
.category[data-category="política"],
.category[data-category="internacional"],
.category[data-category="investigación"],
.news-card[data-category="tecnología"],
.news-card[data-category="ciencia"],
.news-card[data-category="economía"],
.news-card[data-category="educación"],
.news-card[data-category="cultura"],
.news-card[data-category="deporte"],
.news-card[data-category="innovación"],
.news-card[data-category="política"],
.news-card[data-category="internacional"],
.news-card[data-category="investigación"] {
    display: none;
}

/* Colores de las categorías para ambas vistas */
.category[data-category="salud"],
.news-card[data-category="salud"] { 
    color: rgba(96, 165, 250, 0.9); /* Azul */
    border-color: rgba(96, 165, 250, 0.3);
}

.category[data-category="ciencia y tecnología"],
.news-card[data-category="ciencia y tecnología"] { 
    color: rgba(167, 139, 250, 0.9); /* Morado */
    border-color: rgba(167, 139, 250, 0.3);
}

.category[data-category="sociedad"],
.news-card[data-category="sociedad"] { 
    color: rgba(236, 72, 153, 0.9); /* Rosa */
    border-color: rgba(236, 72, 153, 0.3);
}

.category[data-category="global"],
.news-card[data-category="global"] { 
    color: rgba(251, 191, 36, 0.9); /* Amarillo */
    border-color: rgba(251, 191, 36, 0.3);
}

.category[data-category="medio ambiente"],
.news-card[data-category="medio ambiente"] { 
    color: rgba(52, 211, 153, 0.9); /* Verde */
    border-color: rgba(52, 211, 153, 0.3);
}

/* Gradientes y sombras para las tarjetas */
.news-card[data-category="salud"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(96, 165, 250) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(96, 165, 250, 0.3);
}

.news-card[data-category="ciencia y tecnología"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(167, 139, 250) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(167, 139, 250, 0.3);
}

.news-card[data-category="sociedad"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(236, 72, 153) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(236, 72, 153, 0.3);
}

.news-card[data-category="global"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(251, 191, 36) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(251, 191, 36, 0.3);
}

.news-card[data-category="medio ambiente"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(52, 211, 153) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(52, 211, 153, 0.3);
}

.news-card[data-category="otros"] {
    background: linear-gradient(
        160deg,
        var(--card-background) 0%,
        color-mix(in srgb, rgb(203, 213, 225) 20%, var(--card-hover)) 100%
    );
    border-color: rgba(203, 213, 225, 0.3);
}

/* Ocultar scrollbar en la vista de grid */
.grid-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent;
}

.grid-container::-webkit-scrollbar-track {
    background: transparent;
}

.grid-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.grid-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
.grid-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Header */
.site-header {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.4) 0%,
        transparent 100%
    );
    margin-bottom: 1rem;
}

.site-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.site-header h1 .highlight {
    background: linear-gradient(
        90deg,
        rgb(52, 211, 153) 0%,
        rgb(96, 165, 250) 33%,
        rgb(236, 72, 153) 66%,
        rgb(52, 211, 153) 100%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: subtleGradient 12s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

.site-header h1 .subtitle {
    font-size: 0.6em;
    display: block;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

@keyframes subtleGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.source-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.source-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.source-link:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .site-header {
        padding: 2rem 1rem 1.5rem;
    }

    .site-header h1 {
        font-size: 2rem;
    }

    .site-header h1 .subtitle {
        font-size: 0.7em;
        margin-top: 0.75rem;
    }
}

.header-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.author-name {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 400;
}

.twitter-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.twitter-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .header-links {
        gap: 0.75rem;
    }

    .author-info {
        margin-top: 0.25rem;
    }
} 