/* --- CONFIGURACIÓ GENERAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: white;
    overflow-x: hidden;
    scroll-behavior: smooth;
    line-height: 1.6;
}
#particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* --- NAVEGACIÓ --- */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 1rem 2rem; background: rgba(12, 12, 12, 0.9);
    backdrop-filter: blur(10px); transition: 0.3s;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Rajdhani'; color: #00d4ff; font-size: 2rem; font-weight: 600; text-shadow: 0 0 10px rgba(0,212,255,0.5); }
.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a { color: #e0e0e0; text-decoration: none; font-weight: 500; transition: 0.3s; }
.nav-links a:hover { color: #00d4ff; }
.mobile-menu-btn { display: none; background: none; border: none; color: #00d4ff; font-size: 1.5rem; cursor: pointer; }

/* --- HERO --- */
.hero { height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.profile-image {
    width: 300px; height: 300px; border-radius: 50%;
    border: 4px solid #00d4ff; box-shadow: 0 0 30px rgba(0,212,255,0.5);
    margin-bottom: 2rem; animation: float 3s ease-in-out infinite;
    overflow: hidden; margin-left: auto; margin-right: auto;
}
.profile-image img { width: 100%; height: 100%; object-fit: cover; }
h1 { font-family: 'Rajdhani'; font-size: 3.5rem; background: linear-gradient(45deg, #00d4ff, #4ecdc4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cta-button {
    display: inline-block; padding: 12px 35px; margin-top: 2rem;
    background: linear-gradient(45deg, #00d4ff, #4ecdc4);
    color: white; text-decoration: none; border-radius: 50px; font-weight: 600;
}

/* --- SECCIONS --- */
.section { padding: 100px 2rem; max-width: 1200px; margin: 0 auto; opacity: 0; transform: translateY(50px); transition: 0.8s; }
.section.visible { opacity: 1; transform: translateY(0); }
.section-divider { width: 80px; height: 4px; background: linear-gradient(90deg, #00d4ff, #4ecdc4); margin: 0 auto 3rem; }
h2 { font-family: 'Rajdhani'; font-size: 2.5rem; text-align: center; color: #00d4ff; }

/* --- PROJECTS --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
.project-card { background: rgba(255,255,255,0.05); border-radius: 20px; border: 1px solid rgba(0,212,255,0.2); overflow: hidden; cursor: pointer; transition: 0.3s; }
.project-card:hover { transform: translateY(-10px); border-color: #00d4ff; }
.project-image { height: 200px; overflow: hidden; }
.project-image img { width: 100%; height: 100%; object-fit: cover; }
.project-info { padding: 1.5rem; }
.tech-tag { background: rgba(0,212,255,0.2); color: #00d4ff; padding: 0.3rem 0.8rem; border-radius: 15px; font-size: 0.8rem; margin-right: 5px; }

/* --- SKILLS --- */
/* --- SKILLS LOGOS SECTION --- */
.skills-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.skill-category-box h3 {
    font-family: 'Rajdhani', sans-serif;
    color: #00d4ff;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.skills-logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 2rem;
    justify-items: center;
}

.skill-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-logo-item img {
    width: 60px; /* Ajusta segons vulguis la mida dels logos */
    height: 60px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7); /* Logos en gris per defecte */
    transition: all 0.3s ease;
}

.skill-logo-item span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #b0b0b0;
    transition: all 0.3s ease;
}

/* Efecte en passar el ratolí */
.skill-logo-item:hover {
    transform: translateY(-10px);
}

.skill-logo-item:hover img {
    filter: grayscale(0%) opacity(1); /* Recupera el color original */
    transform: scale(1.1);
    drop-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.skill-logo-item:hover span {
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .skills-logos-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columnes en mòbil */
        gap: 1.5rem;
    }
    
    .skill-logo-item img {
        width: 50px;
        filter: grayscale(0%) opacity(1); /* En mòbil millor que es vegin sempre amb color */
    }
}
.skill-item { margin-bottom: 1rem; }
.skill-progress { height: 100%; background: linear-gradient(90deg, #00d4ff, #4ecdc4); width: 0; transition: width 1.5s ease-out; }

/* --- MODALS --- */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; overflow-y: auto; }
.modal-content { background: #1a1a2e; width: 90%; max-width: 700px; margin: 50px auto; padding: 2.5rem; border-radius: 20px; border: 1px solid #00d4ff; position: relative; }
.project-image-modal img { width: 100%; border-radius: 10px; margin-bottom: 1.5rem; }
.modal-features { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.feature-item { background: rgba(0,212,255,0.1); padding: 1rem; border-radius: 10px; border-left: 3px solid #00d4ff; }
.close { position: absolute; top: 1rem; right: 1.5rem; font-size: 2.5rem; color: #00d4ff; cursor: pointer; }
/* Botons dins dels Modals */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.modal-actions .cta-button {
    padding: 10px 25px;
    font-size: 0.9rem;
}

/* Secció de Contacte */
.contact-section { text-align: center; }
.contact-intro { margin-bottom: 2.5rem; color: #b0b0b0; }
.contact-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

.contact-link:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    transform: translateY(-3px);
}

/* Responsivitat per a Mòbil */
@media (max-width: 768px) {
    .contact-row {
        flex-direction: column;
        align-items: center;
    }
    .contact-link { width: 100%; max-width: 250px; justify-content: center; }
    .modal-actions { flex-direction: column; gap: 10px; }
}
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Manté el text a l'esquerra i cards a la dreta */
    gap: 4rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d0d0d0;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.highlight-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* La línia lateral blava que apareix en fer hover */
.highlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(45deg, #00d4ff, #4ecdc4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.highlight-card:hover {
    transform: translateX(10px);
    border-color: #00d4ff;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

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

.highlight-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.highlight-icon {
    width: 25px;
    height: 25px;
    filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.5));
}

.highlight-desc {
    color: #b0b0b0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive per a mòbil */
@media (max-width: 992px) {
    .about-content {
        grid-template-columns: 1fr; /* Una sola columna en mòbils */
        gap: 2rem;
        text-align: center;
    }
    
    .highlight-card:hover {
        transform: translateY(-5px); /* En mòbil millor cap amunt que lateral */
    }
    
    .highlight-title {
        justify-content: center;
    }
}
.feature-title {
    color: #00d4ff; /* Color cian per destacar */
    font-weight: 700; /* Molt més negreta */
    font-size: 1.1rem;
    margin-bottom: 0.5rem; /* Espai amb la descripció */
    text-transform: uppercase; /* Lletres majúscules per a jerarquia */
    letter-spacing: 1px;
}

.feature-desc {
    color: #e0e0e0; /* Gris clar per a la lectura */
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature-desc ul {
    margin-top: 0.5rem;
    padding-left: 1.2rem;
    list-style-type: square; /* Punts quadrats per a un look més tech */
}

.feature-desc li {
    margin-bottom: 0.4rem;
    color: #b0b0b0;
}
/* --- ANIMACIONS I MÒBIL --- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 75%; height: 100vh;
        background: #0c0c0c; flex-direction: column; justify-content: center; align-items: center;
        transition: 0.4s ease-in-out;
    }
    .nav-links.active { right: 0; }
    .projects-grid { grid-template-columns: 1fr; }
    .modal-features { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.5rem; }
}