:root {
    /* PALETA NEON PURPLE & CIAN */
    --primary-bg: #0B0F19;
    --glass-bg: rgba(17, 24, 39, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);

    --primary-text: #EAEAEA;
    --secondary-text: #8892B0;

    /* ACENTO NEON */
    --accent-color: #D32F2F; /* Rojo Oscuro (Principal) */
    --accent-hover-color: #FF5252; /* Rojo Claro (Contorno/Hover) */
    --accent-hover-glow: rgba(255, 82, 82, 0.2); /* Resplandor Rojo */

    --font-family: 'Poppins', sans-serif;
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    color: var(--primary-text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Particles.js Background --- */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--primary-bg);
}

/* --- Estructura Principal --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Header / Navigation --- */
.projects-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--primary-text);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    transition: all var(--transition-speed) ease;
}

.back-button:hover {
    border-color: var(--accent-hover-color);
    color: var(--accent-hover-color);
    box-shadow: 0 0 15px var(--accent-hover-glow);
}

.header-title h1 {
    font-size: 3rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(to right, var(--primary-text), var(--secondary-text));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    color: var(--secondary-text);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--primary-text);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all var(--transition-speed) ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-hover-color);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px var(--accent-hover-glow);
}

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

/* --- Project Card --- */
.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 82, 82, 0.3);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover-color));
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.project-card:hover::before {
    opacity: 1;
}

.project-icon {
    width: 50px;
    height: 50px;
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-hover-color);
    margin-bottom: 1.5rem;
}

.project-info {
    flex-grow: 1;
}

.project-info h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--primary-text);
}

.project-info p {
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--secondary-text);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tag i {
    color: var(--primary-text);
}

.project-links {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-speed);
}

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

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .projects-header {
        align-items: flex-start;
        text-align: left;
    }

    .back-button {
        position: static;
        margin-bottom: 1.5rem;
        display: inline-flex;
    }

    .header-title h1 {
        font-size: 2.2rem;
    }

    .filter-bar {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-bar::-webkit-scrollbar {
        height: 4px;
    }
    
    .filter-bar::-webkit-scrollbar-thumb {
        background: var(--glass-border);
        border-radius: 4px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}