:root {
    --primary-color: #2c3e50;
    --secondary-color: #4b6584; /* Un tono más suave y elegante para los botones secundarios */
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

@keyframes fadeInBox {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

.resume-container {
    max-width: 850px; /* Un poco más ancho para que quepan bien los botones horizontales */
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-top: 8px solid var(--primary-color);
    animation: fadeInBox 0.8s ease-out; 
}

header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.header-content-wrapper {
    display: flex;
    gap: 25px;
    align-items: center;
}

.photo-container {
    flex: 0 0 120px;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease; 
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.header-text-content {
    flex: 1;
}

header h1 {
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-size: 2em;
}

header h2 {
    color: var(--secondary-color);
    font-size: 1.1em;
    font-weight: 500;
    margin: 0 0 12px 0;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85em;
    color: #666;
}

.contact-info p { margin: 0; }

/* --- BOTONES REDISEÑADOS EN FILA HORIZONTAL --- */
.action-buttons {
    display: flex;
    flex-direction: row; /* Ahora están en fila */
    flex-wrap: wrap; /* Si la pantalla es pequeña, bajan a la siguiente línea */
    justify-content: center; /* Centrados debajo de la info */
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.action-buttons button, .action-buttons a {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
    text-align: center;
}

.action-buttons button:hover, .action-buttons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px); /* Pequeño saltito al pasar el ratón */
}

/* El botón de PDF lo mantenemos como el principal destacando un poquito */
#printBtn { background-color: var(--primary-color); }
#printBtn:hover { background-color: #1a252f; }

/* --- ENLACES DENTRO DEL TEXTO DEL PDF --- */
.pdf-link {
    font-size: 0.8em;
    color: #3498db; /* Azul tipo enlace clásico pero elegante */
    text-decoration: none;
    margin-left: 10px;
    font-weight: 600;
    transition: color 0.3s;
}
.pdf-link:hover { color: var(--primary-color); text-decoration: underline; }


/* --- RESTO DEL DISEÑO GENERAL --- */
h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 5px;
    margin-top: 25px;
}

.item { 
    margin-bottom: 15px; 
    padding: 10px; 
    border-radius: 6px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background-color: #fcfcfc;
}

.item h4 { margin: 0 0 5px 0; color: #222; }
.item .date { float: right; color: #777; font-size: 0.9em; }
.item p { margin: 5px 0; }
.item ul { margin-top: 5px; padding-left: 20px; }
.item li { margin-bottom: 5px; }

.skills-grid { display: flex; gap: 40px; }
.skills-column { flex: 1; }
.skills-column ul { list-style-type: none; padding: 0; }

.skills-column li {
    margin-bottom: 8px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-left: 3px solid var(--primary-color);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.skills-column li:hover {
    transform: translateX(8px);
    background-color: #eef2f5;
}

/* --- ESTILOS PARA LA PÁGINA DE PORTFOLIOS EXTRAS --- */
.portfolio-header { text-align: center; margin-bottom: 40px; }
.btn-volver { display: inline-block; background-color: var(--primary-color); color: white; padding: 8px 15px; text-decoration: none; border-radius: 5px; margin-bottom: 20px; font-weight: bold; }
.project-card { background: var(--white); border-left: 5px solid var(--primary-color); padding: 25px; margin-bottom: 30px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.tech-tags { margin-top: 10px; margin-bottom: 15px; }
.tech-tags span { background: var(--primary-color); color: white; padding: 4px 10px; border-radius: 15px; font-size: 0.8em; margin-right: 5px; display: inline-block; }
.project-gallery { display: flex; gap: 15px; margin-top: 20px; overflow-x: auto; padding-bottom: 10px; }
.project-gallery img { height: 250px; border-radius: 8px; border: 2px solid #eee; object-fit: cover; transition: transform 0.3s ease; }
.project-gallery img:hover { transform: scale(1.02); }

.btn-codigo { background-color: var(--secondary-color); color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; margin-top: 15px; margin-bottom: 15px; transition: background 0.3s; }
.btn-codigo:hover { background-color: var(--primary-color); }

.codigo-bloque { background-color: #1e1e1e; color: #d4d4d4; padding: 20px; border-radius: 8px; overflow-x: auto; font-family: Consolas, 'Courier New', monospace; font-size: 0.85em; margin-bottom: 20px; border-left: 4px solid #5dade2; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }
.codigo-bloque h4 { color: #4ec9b0; margin-top: 0; margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 5px; }
.codigo-bloque pre { margin: 0; }
.codigo-bloque pre code { color: #9cdcfe; }

/* --- IMPRESIÓN Y PDF --- */
@media print {
    body { background-color: var(--white); padding: 0; }
    .resume-container { box-shadow: none; border-top: none; padding: 0; max-width: 100%; animation: none !important; }
    
    /* Desactivar botones al imprimir, PERO LOS ENLACES DEL TEXTO SÍ SE VERÁN */
    .action-buttons { display: none !important; }
    
    * { transition: none !important; transform: none !important; animation: none !important; }
    .item { padding: 0; box-shadow: none !important; background-color: transparent !important; }
    
    /* Asegurarnos que los links del texto se impriman en azul oscuro para que se note que se pueden clickar */
    .pdf-link { color: #2980b9 !important; text-decoration: underline !important; }
}

/* --- ADAPTACIÓN PARA MÓVILES --- */
@media (max-width: 600px) {
    .header-content-wrapper { flex-direction: column; text-align: center; gap: 15px; }
    .contact-info { justify-content: center; }
    .action-buttons { flex-direction: column; width: 100%; } /* En móvil vuelven a apilarse para no salirse de la pantalla */
    .skills-grid { flex-direction: column; gap: 0; }
    .item .date { float: none; display: block; }
}

/* --- MODO OSCURO (DARK MODE) --- */
body.dark-mode { background-color: #121212; color: #e0e0e0; }
body.dark-mode .resume-container { background: #1e1e1e; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border-top: 8px solid #5dade2; }
body.dark-mode header h1, body.dark-mode h3 { color: #5dade2; border-bottom-color: #5dade2; }
body.dark-mode header h2 { color: #85c1e9; }
body.dark-mode .contact-info { color: #aaa; }
body.dark-mode .item h4 { color: #f4f4f4; }
body.dark-mode .item .date { color: #bbb; }
body.dark-mode header { border-bottom: 2px solid #333; }

/* Botones en modo oscuro (todos uniformes) */
body.dark-mode .action-buttons button, 
body.dark-mode .action-buttons a { background-color: #2c3e50; color: #ecf0f1; border: 1px solid #34495e; }
body.dark-mode .action-buttons button:hover, 
body.dark-mode .action-buttons a:hover { background-color: #5dade2; color: #121212; border-color: #5dade2; }

/* Enlaces del texto en modo oscuro */
body.dark-mode .pdf-link { color: #5dade2; }

body.dark-mode .skills-column li { background: #2a2a2a; border-left: 3px solid #5dade2; color: #e0e0e0; }
body.dark-mode .skills-column li:hover { background-color: #333; }
body.dark-mode .item:hover { background-color: #2a2a2a; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
body.dark-mode .profile-photo { border-color: #5dade2; }
body.dark-mode .btn-volver { background-color: #5dade2; color: #121212; }
body.dark-mode .project-card { background: #1e1e1e; border-left-color: #5dade2; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
body.dark-mode .tech-tags span { background: #5dade2; color: #121212; }
body.dark-mode .project-gallery img { border-color: #333; }
body.dark-mode .btn-codigo { background-color: transparent; border: 2px solid #5dade2; color: #5dade2; }
body.dark-mode .btn-codigo:hover { background-color: #5dade2; color: #121212; }

@media print {
    body.dark-mode { background-color: white; color: #333; }
    body.dark-mode .resume-container { background: white; border-top: 8px solid #2c3e50; }
    body.dark-mode header h1, body.dark-mode h3 { color: #2c3e50; border-bottom-color: #2c3e50; }
    body.dark-mode header h2 { color: #34495e; }
    body.dark-mode .item h4 { color: #222; }
    body.dark-mode .skills-column li { background: #f8f9fa; color: #333; border-left: 3px solid #2c3e50; }
}
/* --- AÑADIDO: ESTILOS PARA LA PÁGINA DE PORTFOLIO --- */
#portfolioBtn {
    background-color: #4b6584;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
    text-align: center;
    display: block; /* Para que encaje igual que los otros botones */
}
#portfolioBtn:hover { background-color: #3a506b; transform: translateY(-2px); }
body.dark-mode #portfolioBtn { background-color: #2c3e50; color: white; border: 1px solid #34495e; }
body.dark-mode #portfolioBtn:hover { background-color: #5dade2; color: #121212; border-color: #5dade2; }

.portfolio-header {
    text-align: center;
    margin-bottom: 40px;
}

.btn-volver {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
}
body.dark-mode .btn-volver { background-color: #5dade2; color: #121212; }

.project-card {
    background: var(--white);
    border-left: 5px solid var(--primary-color);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
body.dark-mode .project-card {
    background: #1e1e1e;
    border-left-color: #5dade2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.tech-tags { margin-top: 10px; margin-bottom: 15px; }
.tech-tags span {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    margin-right: 5px;
    display: inline-block;
}
body.dark-mode .tech-tags span { background: #5dade2; color: #121212; }

.project-gallery {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.project-gallery img {
    height: 250px;
    border-radius: 8px;
    border: 2px solid #eee;
    object-fit: cover;
    transition: transform 0.3s ease;
}
body.dark-mode .project-gallery img { border-color: #333; }
.project-gallery img:hover { transform: scale(1.02); }
/* --- AÑADIDO: ESTILOS PARA EL DESPLEGABLE DE CÓDIGO --- */
.btn-codigo {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 15px;
    transition: background 0.3s;
}
.btn-codigo:hover { background-color: var(--primary-color); }

body.dark-mode .btn-codigo { 
    background-color: transparent; 
    border: 2px solid #5dade2; 
    color: #5dade2;
}
body.dark-mode .btn-codigo:hover { 
    background-color: #5dade2; 
    color: #121212; 
}

.codigo-bloque {
    background-color: #1e1e1e; /* Fondo estilo Visual Studio */
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto; /* Para que aparezca barra de scroll si la línea es muy larga */
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.85em;
    margin-bottom: 20px;
    border-left: 4px solid #5dade2;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.codigo-bloque h4 {
    color: #4ec9b0; /* Verde menta estilo clases en C# */
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.codigo-bloque pre { margin: 0; }
/* --- AÑADIDO: ESTILO PARA EL BOTÓN DE APLICACIONES IA Y ETIQUETAS DE TEXTO --- */
#appsBtn {
   background-color: #576574; /* Color púrpura tecnológico elegante */
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
    text-align: center;
    display: block;
}
#appsBtn:hover { background-color: #576574; transform: translateY(-2px); }
body.dark-mode #appsBtn { background-color: #2c3e50; color: white; border: 1px solid #34495e; }
body.dark-mode #appsBtn:hover { background-color: #5dade2; color: #121212; border-color: #5dade2; }
/* Asegurar el formateo correcto de las etiquetas de código embebidas */
.codigo-bloque pre code {
    color: #9cdcfe; /* Color azul claro para variables en el visor */
}
/* --- AÑADIDO: ESTILO PARA EL BOTÓN DE HARDWARE --- */
#hardwareBtn {
   background-color: #2c3e50; /* Color naranja oscuro / industrial */
    color: white;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
    text-align: center;
    display: block;
}
#hardwareBtn:hover { background-color: #1a252f; transform: translateY(-2px); }
body.dark-mode #hardwareBtn { background-color: #2c3e50; color: white; border: 1px solid #34495e; }
body.dark-mode #hardwareBtn:hover { background-color: #5dade2; color: #121212; border-color: #5dade2; }

/* Para incrustar videos de YouTube de forma responsiva */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 8px;
    margin-top: 15px;
    border: 2px solid #333;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}