/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Inter:wght@300;400;600&display=swap');

/* --- CSS Variables --- */
:root {
    --bg-main: #050505;
    --bg-card: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #00c7b1;
    --accent-dark: #00a693;
    --nav-bg: rgba(5, 5, 5, 0.8);
    --spacing-section: 40px;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Global Reset & Base Styles --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-main); color: var(--text-secondary); line-height: 1.6; overflow-x: hidden; position: relative; width: 100%; }
h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; color: var(--text-primary); }
.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* --- Reading Progress Bar --- */
.reading-progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 2000; transition: width 0.1s ease-out; }

/* --- Background Blobs --- */
.bg-blob { position: fixed; width: 300px; height: 300px; background: radial-gradient(circle, rgba(0, 199, 177, 0.05) 0%, transparent 70%); border-radius: 50%; filter: blur(60px); z-index: -1; pointer-events: none; }
.blob-1 { top: 0; left: 0; }
.blob-2 { bottom: 0; right: 0; }

/* --- Navigation Base (Mobile) --- */
.main-nav { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; background: var(--nav-bg); backdrop-filter: blur(15px); position: fixed; top: 0; left: 0; width: 100%; height: 70px; z-index: 1000; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.nav-links { list-style: none; display: none; flex-direction: column; position: absolute; top: 70px; left: 0; width: 100%; background: rgba(5, 5, 5, 0.98); padding: 40px 20px; text-align: center; gap: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.nav-links.active { display: flex; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 600; text-transform: uppercase; font-size: 0.95rem; letter-spacing: 1px; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.hamburger-menu { display: block; background: none; border: none; color: var(--text-primary); font-size: 1.8rem; cursor: pointer; }
.sidebar-pic { display: none; }

/* --- Hero Section --- */
.hero-header { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 120px 20px 60px; background-image: linear-gradient(to bottom, rgba(5, 5, 5, 0.4), rgba(5, 5, 5, 1)), url('../img/backgrounds/code_init.jpg'); background-size: cover; background-position: center; }

@keyframes bubbleFloat { 0% { transform: translateY(0); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0); } }
.floating-profile-container { margin-bottom: 25px; animation: bubbleFloat 5s ease-in-out infinite; }
.floating-profile-pic { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); box-shadow: 0 10px 30px rgba(0, 199, 177, 0.3); }

h1 { font-size: 2.2em; margin-bottom: 10px; line-height: 1.2; }
.hero-header .subtitle { color: var(--accent); font-size: 1.1em; margin-bottom: 20px; }
.hero-header .intro-text { font-size: 0.95em; max-width: 600px; margin: 0 auto 30px; }

/* --- Sections & Components --- */
section { padding: 40px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
h2 { font-size: 2em; margin-bottom: 25px; text-align: center; }

/* --- Puesto de Trabajo: Refined --- */
.experience-list { display: flex; flex-direction: column; gap: 20px; }
.puesto_de_trabajo { background: var(--bg-card); padding: 25px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.03); transition: var(--transition-smooth); }
.puesto_de_trabajo:hover { border-color: var(--accent); transform: translateY(-3px); }
.work-header { margin-bottom: 15px; }
.work-header h4 { color: var(--accent); font-size: 1.2rem; margin-bottom: 5px; }
.work-header p { font-size: 0.9rem; color: var(--text-primary); }

.work-body { display: flex; flex-direction: column; gap: 15px; }
.work-evidence { width: 100%; max-width: 200px; }
.evidence-thumb { width: 100%; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }

/* --- Grid Structures (Main Projects Carousel) --- */
.portfolio-wrapper { position: relative; width: 100%; display: flex; align-items: center; }

.portfolio-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    gap: 20px;
    padding: 20px 20px 40px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.portfolio-grid::-webkit-scrollbar { display: none; }

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-100%);
    width: 40px;
    height: 40px;
    background: rgba(0, 199, 177, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: var(--transition-smooth);
    opacity: 0.6;
}

.scroll-arrow:hover { opacity: 1; background: var(--accent); color: var(--bg-main); box-shadow: 0 0 15px var(--accent); }
.arrow-left { left: 5px; }
.arrow-right { right: 5px; }

@media (max-width: 768px) {
    .scroll-arrow { width: 35px; height: 35px; opacity: 0.4; } /* Más sutiles en móvil */
}

.project-card {
    width: calc(100vw - 80px); /* Ancho preciso: Pantalla menos márgenes laterales */
    max-width: 400px; /* Evita que en tablets pequeñas sea gigante */
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    scroll-snap-align: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .project-card {
        width: 380px; /* Ancho fijo para tablets y laptops */
    }
}

@media (max-width: 480px) {
    .project-carousel { height: 200px; } /* Reducimos altura de imagen en móviles pequeños */
    .project-content h3 { font-size: 1.3rem; }
    .project-content { padding: 15px; }
}

.project-card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 199, 177, 0.1); }

/* --- Internal Project Image Carousel --- */
.project-carousel { position: relative; width: 100%; height: 280px; overflow: hidden; background: #000; border-radius: 12px; margin: 15px 0; border: 1px solid rgba(255, 255, 255, 0.03); }
.project-track { display: flex; height: 100%; transition: transform 0.5s ease-in-out; align-items: center; }
.project-slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(0, 199, 177, 0.05) 0%, transparent 70%); }
.project-slide img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 5px; }

.project-nav { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 10; padding: 4px 8px; background: rgba(0,0,0,0.5); border-radius: 20px; backdrop-filter: blur(4px); }
.p-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); cursor: pointer; transition: 0.3s; }
.p-dot.active { background: var(--accent); transform: scale(1.3); }

.project-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.project-date { color: var(--accent); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 1px; }
.project-content h3 { font-size: 1.6rem; color: var(--text-primary); margin-bottom: 5px; }
.project-content p { font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); margin-top: 10px; }

.project-links { margin-top: auto; display: flex; gap: 15px; }
.repo-link { display: flex; align-items: center; gap: 8px; color: var(--text-primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: var(--accent); }
.repo-link:hover { color: var(--accent); }
.repo-link i { font-size: 1.2rem; }

.image-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.gallery-item { border-radius: 10px; overflow: hidden; aspect-ratio: 1/1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.gallery-item:hover img { transform: scale(1.1); }

.tech-icons { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.tech-icons img { width: 45px; height: 45px; }

/* --- Footer --- */
.main-footer { padding: 60px 20px; text-align: center; }
.social-links a { color: var(--text-secondary); font-size: 2rem; margin: 0 15px; transition: var(--transition-smooth); }
.social-links a:hover { color: var(--accent); transform: translateY(-5px); }

.cta-button { display: inline-block; border: 2px solid var(--accent); color: var(--accent) !important; padding: 12px 35px; border-radius: 100px; text-decoration: none; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; transition: var(--transition-smooth); background: transparent; }
.cta-button:hover { background-color: var(--accent); color: var(--bg-main) !important; transform: scale(1.05); box-shadow: 0 10px 20px rgba(0, 199, 177, 0.3); }

/* --- Animations --- */
.reveal-hidden { opacity: 0; transform: translateY(20px); transition: all 0.6s ease-out; }
.revealed { opacity: 1 !important; transform: translateY(0) !important; }

/*******************************************************************************
 * MEDIA QUERIES
 *******************************************************************************/

@media (min-width: 768px) {
    .work-body { flex-direction: row; align-items: flex-start; justify-content: space-between; }
    .work-body p { flex: 1; }
    .work-evidence { max-width: 180px; margin-left: 20px; }
}

@media (min-width: 1024px) {
    .main-nav { width: 280px; height: 100vh; flex-direction: column; padding: 60px 20px; border-right: 1px solid rgba(255, 255, 255, 0.05); border-bottom: none; }
    .nav-container { flex-direction: column; justify-content: flex-start; height: 100%; max-width: 100%; padding: 0; }
    .nav-links { display: flex !important; position: static; flex-direction: column; background: none; padding: 0; gap: 25px; width: 100%; border: none; }
    .hamburger-menu { display: none; }
    .sidebar-pic { display: block !important; width: 160px; height: 160px; margin-bottom: 30px; position: relative; }
    .sidebar-pic img { width: 160px; height: 160px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
    .sidebar-pic::after { content: ""; position: absolute; top: -8px; left: -8px; right: -8px; bottom: -8px; border: 1px solid var(--accent); border-radius: 50%; opacity: 0.3; }
    .hero-header, main, .main-footer { margin-left: 280px; width: calc(100% - 280px); }
    .container { max-width: 1100px; padding: 0 50px; }
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .image-gallery { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    h1 { font-size: 3.5em; }
    h2 { font-size: 2.8em; }
}

/* --- Carousel & Certifications --- */
.carousel-container { position: relative; width: 100%; overflow: hidden; margin-top: 20px; }
.carousel-track { display: flex; transition: transform 0.5s ease-in-out; }
.carousel-slide { min-width: 100%; padding: 10px; text-align: center; }
.carousel-slide img { width: 100%; max-height: 400px; object-fit: contain; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.1); background: var(--bg-card); }
.carousel-caption { margin-top: 15px; color: var(--text-primary); font-weight: 600; }

.carousel-dots { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); cursor: pointer; transition: var(--transition-smooth); }
.dot.active { background: var(--accent); transform: scale(1.2); }

.other-certs { margin-top: 50px; }
.certs-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 20px; }
.cert-item { background: var(--bg-card); padding: 15px 20px; border-radius: 10px; border-left: 4px solid var(--accent); display: flex; align-items: center; justify-content: space-between; transition: var(--transition-smooth); }
.cert-item:hover { transform: translateX(10px); background: rgba(0, 199, 177, 0.05); }
.cert-name { color: var(--text-primary); font-weight: 500; }
.cert-issuer { font-size: 0.85rem; color: var(--text-secondary); }

@media (min-width: 768px) {
    .certs-list { grid-template-columns: 1fr 1fr; }
}

/* --- Tech Setup Section --- */
.tech-setup-container { display: flex; flex-direction: column; gap: 30px; align-items: center; margin-top: 30px; }
.setup-image-wrapper { width: 100%; max-width: 600px; position: relative; border-radius: 15px; overflow: hidden; box-shadow: 0 0 30px rgba(0, 199, 177, 0.2); border: 1px solid rgba(0, 199, 177, 0.3); }
.setup-image-wrapper img { width: 100%; display: block; filter: saturate(1.2); }

.specs-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.spec-item { background: var(--bg-card); padding: 20px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05); text-align: left; position: relative; overflow: hidden; }
.spec-item::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--accent); }
.spec-label { font-size: 0.75rem; text-transform: uppercase; color: var(--accent); letter-spacing: 1px; margin-bottom: 5px; font-weight: 700; }
.spec-value { font-size: 1rem; color: var(--text-primary); font-weight: 600; }

.optimization-note { background: rgba(0, 199, 177, 0.05); border: 1px dashed var(--accent); padding: 20px; border-radius: 12px; margin-top: 20px; font-size: 0.9rem; line-height: 1.6; }

@media (min-width: 1024px) {
    .tech-setup-container { flex-direction: row; align-items: flex-start; }
    .setup-image-wrapper { flex: 1; }
    .specs-content { flex: 1; }
}
