/* Variables globales */
:root {
    --primary-color: #1a1a2e;
    --accent-color: #e94560;
    --light-accent: #0f3460;
    --dark-color: #16213e;
    --light-color: #f1f1f1;
    --font-main: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;
    --transition: all 0.3s ease;
}

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

html {
    overflow-y: scroll; /* Esto fuerza que siempre exista la barra de desplazamiento */
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
    margin-right: 0 !important; /* Evita ajustes automáticos de margen */
}

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

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

.btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--light-color);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(233, 69, 96, 0.2);
}

.btn:hover {
    background: #d03854;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(233, 69, 96, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 25px;
}

.view-all {
    margin: 2rem auto;
    display: block;
    width: fit-content;
}

/* Header - Ajuste para el logo negro */
header {
    background-color: white;
    color: var(--primary-color);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header.scrolled {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 180px;
    height: auto;
    margin-right: 1.2rem;
}

.site-title h1 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: 1px;
}

.tagline {
    font-size: 0.9rem;
    color: #666;
    font-weight: 300;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
    padding-bottom: 0.3rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* Hero section - ajustado para coincidir con el estilo del header */
.hero {
    background: linear-gradient(rgba(22, 33, 62, 0.9), rgba(26, 26, 46, 0.95)), url('../img/cybersecurity-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--light-color);
    text-align: center;
    padding: 6rem 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/pattern.png');
    opacity: 0.05;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    font-weight: 300;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

section {
    margin-bottom: 5rem;
}

section h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 0.8rem;
    font-size: 2.2rem;
    font-weight: 700;
}

section h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    position: relative;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.news-content {
    padding: 1.8rem;
}

.news-date {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.news-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    line-height: 1.3;
    font-weight: 700;
}

.news-excerpt {
    color: #444;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.news-card .btn-small {
    background: var(--light-accent);
    margin-top: 0.5rem;
}

.news-card .btn-small:hover {
    background: var(--accent-color);
}

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-item {
    display: flex;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-item-image {
    width: 320px;
    object-fit: cover;
}

.news-item-content {
    padding: 2rem;
    flex: 1;
}

/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.category-card {
    background: white;
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--accent-color);
    transform: translateY(-100%);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.category-card:hover::before {
    transform: translateY(0);
}

.category-card i {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.category-card:hover i {
    transform: scale(1.1);
}

.category-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.category-card p {
    color: #444;
    line-height: 1.7;
}

/* Footer - Adaptación para el logo negro */
footer {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 4rem 5% 1.5rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/pattern.png');
    opacity: 0.03;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-small {
    width: 120px;
    height: auto;
    margin-bottom: 1.2rem;
    background-color: white;
    padding: 12px;
    border-radius: 8px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.footer-logo p {
    color: rgba(241, 241, 241, 0.7);
    font-weight: 300;
    margin-bottom: 1rem;
}

.footer-contact {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.footer-contact a {
    color: rgba(241, 241, 241, 0.8);
    transition: var(--transition);
}

.footer-contact a:hover {
    color: var(--accent-color);
}

.footer-links h4,
.footer-social h4,
.footer-newsletter h4 {
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-links h4::after,
.footer-social h4::after,
.footer-newsletter h4::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links ul li a {
    color: rgba(241, 241, 241, 0.7);
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-links ul li a:hover {
    color: var(--accent-color);
    margin-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1.2rem;
}

.social-icons a {
    color: var(--light-color);
    font-size: 1.6rem;
    transition: var(--transition);
    opacity: 0.8;
}

.social-icons a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
    opacity: 1;
}

.footer-newsletter form {
    display: flex;
    margin-top: 1.5rem;
}

.footer-newsletter input {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 25px 0 0 25px;
    width: 100%;
    outline: none;
}

.footer-newsletter button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    padding: 0 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.footer-newsletter button:hover {
    background: #d03854;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(241, 241, 241, 0.1);
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    color: rgba(241, 241, 241, 0.7);
}

/* Page header for internal pages */
.page-header {
    background: linear-gradient(rgba(22, 33, 62, 0.9), rgba(26, 26, 46, 0.95)), url('../img/header-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 5rem 2rem;
    text-align: center;
    color: var(--light-color);
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.page-header p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    font-weight: 300;
}

/* News filters */
.news-filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-container {
    display: flex;
    max-width: 400px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 25px 0 0 25px;
    outline: none;
}

.search-btn {
    background: var(--light-accent);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    padding: 0 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--accent-color);
}

.filter-container {
    display: flex;
}

.filter-select {
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

/* Article page styles */
.news-article {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.news-article h1 {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    line-height: 1.3;
    font-weight: 800;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.article-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    margin-bottom: 2.5rem;
    border-radius: 8px;
}

.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 2.5rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.article-content h2 {
    margin: 2.5rem 0 1.2rem;
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: left;
}

.article-content h2::after {
    display: none;
}

.article-content ul, .article-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

.article-content li {
    margin-bottom: 0.8rem;
}

.article-tags {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.article-tags span:first-child {
    font-weight: 600;
    color: #444;
}

.article-tags .tag {
    background: #f1f1f1;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.article-tags .tag:hover {
    background: var(--light-accent);
    color: white;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .news-item {
        flex-direction: column;
    }
    
    .news-item-image {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .logo-container {
        margin-bottom: 1.5rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    nav ul li {
        margin: 0;
    }
    
    .hero {
        padding: 4rem 1.5rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .news-filters {
        flex-direction: column;
    }
    
    .search-container, .filter-container {
        max-width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        align-items: center;
    }
    
    .footer-links h4::after,
    .footer-social h4::after,
    .footer-newsletter h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-newsletter form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-newsletter input,
    .footer-newsletter button {
        border-radius: 25px;
    }
    
    .news-article {
        padding: 1.5rem;
    }
    
    .news-article h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    section h2 {
        font-size: 1.8rem;
    }
    
    .category-card {
        padding: 2rem 1.5rem;
    }
}

/* Estilos responsivos mejorados */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }
    
    .logo-container {
        margin-bottom: 1rem;
        justify-content: center;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 0.5rem 0;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .featured-news, .recent-news, .categories {
        padding: 2rem 1rem;
    }
    
    .news-grid, .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-logo, .footer-links, .footer-social, .footer-newsletter {
        width: 100%;
        text-align: center;
    }
    
    .footer-newsletter form {
        flex-direction: column;
    }
    
    .footer-newsletter input {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .footer-newsletter button {
        width: 100%;
    }
    
    /* Mejoras para la página de noticias */
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Mejoras para la página de vulnerabilidades */
    .vulnerability-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    /* Mejoras para la página de sobre nosotros */
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .team-member {
        flex-direction: column;
    }
    
    .team-member img {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 1.5rem auto;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mejoras para la página de tutoriales */
    .tutorials-container {
        grid-template-columns: 1fr;
    }
    
    .filters-container {
        padding: 1rem;
    }
    
    .category-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .category-btn {
        margin-bottom: 0.5rem;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 480px) {
    .logo {
        width: 60px;
    }
    
    .site-title h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .news-card, .category-card, .vulnerability-card, .tutorial-card {
        margin-bottom: 1.5rem;
    }
    
    .news-content, .vulnerability-content, .tutorial-content {
        padding: 1rem;
    }
    
    .news-title, .vulnerability-title, .tutorial-title {
        font-size: 1.1rem;
    }
    
    .btn, .tutorial-link {
        width: 100%;
        text-align: center;
    }
    
    .page-header {
        padding: 2rem 1rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* Estilos para menú hamburguesa en móvil */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: white;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 999;
        padding: 5rem 1.5rem 1.5rem;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        margin: 0;
    }
    
    nav ul li {
        margin: 1rem 0;
        width: 100%;
    }
    
    nav ul li a {
        display: block;
        width: 100%;
        padding: 0.8rem 0;
        font-size: 1.1rem;
    }

    body.menu-open {
        overflow: hidden;
    }
}
