/* =================================================================== */
/* HOJA DE ESTILOS - Portafolio Jordi Martínez                       */
/* =================================================================== */

/* --- Reset y Variables Globales --- */
:root {
    --primary-color: #333;
    --secondary-color: #777;
    --background-color: #ffffff;
    --light-gray-color: #f4f4f4;
    --border-color: #ddd;
    --dark-accent-color: #1A2B45;
    --draw-duration: 2.5s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif; /* Recomiendo importar 'Lato' desde Google Fonts en tu header.php */
    color: var(--primary-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-weight: 700;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Estructura General de Secciones --- */
section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}
section:last-of-type, .hero {
    border-bottom: none;
}
h2.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* --- Header --- */
.main-header {
    background: var(--background-color);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 700;
    font-size: 1.5rem;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}
.main-nav a {
    color: var(--secondary-color);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}
.main-nav a:hover {
    color: var(--primary-color);
}
.btn-contact {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s;
}
.btn-contact:hover {
    background-color: #555;
}


/* --- Hero Section --- */
.hero {
    padding: 100px 0;
}
.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
}
.hero-text {
    flex: 1.5;
    text-align: left;
}
.hero-profile-image {
    width: 150px;
    height: 150px;
    margin-bottom: 25px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.hero-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-text h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}
.hero-image-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
#mi-logo-contenedor { width: 100%; max-width: 350px; }
#mi-logo-contenedor svg { width: 100%; height: 100%; display: block; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
#frame-outer { stroke: var(--secondary-color); stroke-dasharray: 2416; stroke-dashoffset: 2416; animation: draw-line var(--draw-duration) ease-out forwards; }
#frame-inner { stroke: var(--secondary-color); stroke-dasharray: 2416; stroke-dashoffset: 2416; animation: draw-line var(--draw-duration) ease-out forwards 0.5s; }
#letter-j { stroke: var(--primary-color); stroke-dasharray: 595; stroke-dashoffset: 595; animation: draw-line var(--draw-duration) ease-in-out forwards 1s; }
.hero-links { display: flex; align-items: center; gap: 25px; }
.social-icons { display: flex; gap: 20px; }
.social-icons a { color: var(--secondary-color); font-size: 1.2rem; }
.scroll-down-arrow {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--secondary-color);
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-15px); }
    60% { transform: translateX(-50%) translateY(-8px); }
}


/* --- Sección Estudios (Timeline Horizontal) --- */
.studies {
    background-color: var(--light-gray-color);
}
.timeline-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding-top: 50px;
    align-items: stretch;
}
.timeline-container::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 5%;
    width: 90%;
    height: 2px;
    background-color: var(--border-color);
}
.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 18%;
    position: relative;
}
.timeline-node {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    border: 5px solid var(--light-gray-color);
    z-index: 1;
    position: absolute;
    top: 0;
    transform: translateY(-50%);
    transition: background-color 0.3s ease;
}
.timeline-node::after {
    content: '';
    position: absolute;
    bottom: -15px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid var(--secondary-color);
    transition: border-top-color 0.3s ease;
}
.timeline-content {
    background-color: white;
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-top: 60px;
    width: 100%;
    text-align: center;
    border-top: 5px solid var(--secondary-color);
    height: 100%;
    transition: all 0.3s ease;
}
.timeline-content i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}
.timeline-item:hover .timeline-node { background-color: var(--dark-accent-color); }
.timeline-item:hover .timeline-node::after { border-top-color: var(--dark-accent-color); }
.timeline-item:hover .timeline-content {
    background-color: var(--dark-accent-color);
    border-top-color: var(--dark-accent-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.timeline-item:hover .timeline-content * { color: white; }

/* --- Sección Experiencia (2 Columnas) --- */
.experience-content {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}
.skills-column {
    flex: 1;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px rgba(0,0,0,0.07);
    background-color: var(--background-color);
    /* Para el fondo de textura, descomenta esto y asegúrate de tener la imagen */
    /* background-image: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url('../assets/textura.png'); */
}
.experience-timeline {
    flex: 2;
    position: relative;
    padding-left: 30px;
}
.experience-timeline::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 4px;
    width: 2px;
    height: calc(100% - 20px);
    background-color: var(--border-color);
}
.timeline-item-vertical {
    position: relative;
    margin-bottom: 30px;
}
.timeline-item-vertical::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -33px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    z-index: 1;
}
.timeline-item-vertical h4 { font-size: 1.2rem; }
.timeline-item-vertical .date { color: var(--secondary-color); font-weight: 400; margin-left: 10px; }

/* --- Sección Proyectos --- */
.projects {
    background-color: var(--light-gray-color);
}
.project-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.project-item {
    transition: all 0.4s ease;
}
.project-item.main {
    text-align: center;
    flex-shrink: 0;
    width: 50%;
}
.project-item.side {
    opacity: 0.5;
    transform: scale(0.85);
    flex-shrink: 0;
    width: 25%;
}
.arrow {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--secondary-color);
    cursor: pointer;
}
.tags .tag {
    display: inline-block;
    background-color: var(--border-color);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 5px;
}

/* --- Sección Contacto --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background-color: var(--light-gray-color);
    padding: 40px;
    border-radius: 8px;
}
.contact-info p {
    margin-bottom: 10px;
}
.contact-info .social-icons {
    justify-content: flex-start;
}
.contact-form .form-group {
    margin-bottom: 20px;
}
.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: 'Lato', sans-serif;
}
.btn-submit {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--dark-accent-color);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn-submit:hover {
    background-color: var(--primary-color);
}


/* --- Footer --- */
.main-footer {
    background-color: var(--primary-color);
    color: #aab0b6;
    padding: 40px 0;
    border-bottom: none;
}
.main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-footer .social-icons a {
    color: white;
}

/* --- Media Queries para Responsividad --- */
@media (max-width: 992px) {
    .hero-content, .experience-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-text {
        order: 2;
    }
    .hero-image-area {
        order: 1;
        margin-bottom: 40px;
    }
    .timeline-container {
        flex-direction: column;
        gap: 30px;
    }
    .timeline-item {
        width: 100%;
    }
    .timeline-container::before, .timeline-node, .timeline-node::after {
        display: none; /* Ocultar timeline horizontal en móvil, muy difícil de adaptar */
    }
    .timeline-content {
        margin-top: 0;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }
    .project-carousel {
        flex-direction: column;
    }
    .project-item.side {
        display: none; /* Ocultar items laterales en móvil */
    }
    .project-item.main {
        width: 100%;
    }
    .main-footer .container {
        flex-direction: column;
        gap: 20px;
    }
}