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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
    padding-top: 80px; /* Espacio para el menú de navegación */
}

/* Ajustar padding cuando se genera PDF */
body.pdf-generating {
    padding-top: 20px;
}

/* Menú de navegación - No aparece en PDF/ATS */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #3498db;
    background-color: #f8f9fa;
}

.nav-link.active {
    color: #3498db;
    background-color: #e8f4f8;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: #3498db;
    border-radius: 3px 3px 0 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: calc(100vh - 100px);
}

/* Contacto en la parte superior en una línea */
.top-contact {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 11px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.top-contact::-webkit-scrollbar {
    height: 4px;
}

.top-contact::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.contact-item-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 0;
}

.contact-item-inline .icon {
    font-size: 12px;
    flex-shrink: 0;
}

.contact-item-inline span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.contact-link-inline {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.contact-link-inline:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Sección compacta para Certificaciones, Habilidades, Educación e Idiomas */
.compact-section {
    margin-top: 20px;
}

.compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.compact-column {
    display: flex;
    flex-direction: column;
}

.compact-column h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Certificaciones compactas */
.certification-item-compact {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.certification-item-compact:last-child {
    border-bottom: none;
}

.cert-compact-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.cert-institution-compact {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.cert-date-compact {
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.cert-title-compact {
    font-size: 13px;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* Habilidades compactas */
.skills-subtitle-compact {
    font-size: 14px;
    font-weight: 600;
    color: #3498db;
    margin-top: 15px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skills-subtitle-compact:first-child {
    margin-top: 0;
}

.skill-category-compact {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

.skill-category-compact strong {
    color: #3498db;
    font-weight: 600;
}

.soft-skills-compact {
    margin-top: 15px;
}

.soft-skills-text-compact {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Educación compacta */
.education-compact {
    margin-top: 25px;
}

.education-item-compact {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.education-item-compact strong {
    color: #2c3e50;
    font-weight: 600;
}

.education-note-compact {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 4px;
    font-style: italic;
}

/* Idiomas compactos */
.languages-compact {
    margin-top: 25px;
}

.languages-compact p {
    font-size: 13px;
    color: #555;
    margin: 0;
}

/* Responsive para sección compacta */
@media (max-width: 900px) {
    .compact-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.profile-photo {
    width: 100%;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.profile-photo img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #34495e;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: block;
}

/* Reducir tamaño de imagen para PDF */
@media print {
    .profile-photo img {
        width: 120px;
        height: 120px;
        border: 3px solid #34495e;
    }
    
    .profile-photo {
        margin-bottom: 15px;
    }
    
    .sidebar {
        padding: 20px 20px;
    }
    
    .sidebar section {
        margin-bottom: 20px;
    }
}

/* Si no hay foto, ocultar el contenedor */
.profile-photo img[style*="display: none"] {
    display: none !important;
}

.profile-photo:empty {
    display: none;
}

.sidebar section {
    margin-bottom: 35px;
}

.sidebar h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    color: #ecf0f1;
    border-bottom: 2px solid #34495e;
    padding-bottom: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.contact-item .icon {
    margin-right: 10px;
    font-size: 16px;
}

.contact-link {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Educación en el contenido principal */
.main-content .education-item {
    margin-bottom: 20px;
}

.main-content .education-item h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
}

.main-content .education-item p {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.main-content .education-note {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Idiomas en el contenido principal */
.main-content .languages ul {
    list-style: none;
    padding-left: 0;
}

.main-content .languages ul li {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.main-content .languages ul li:before {
    content: "• ";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    font-size: 13px;
    margin-bottom: 8px;
    color: #ecf0f1;
    padding-left: 5px;
}

.sidebar ul li:before {
    content: "• ";
    color: #3498db;
    font-weight: bold;
    margin-right: 5px;
}

/* Estilos para Hard Skills y Soft Skills en el contenido principal */
.main-content .skills-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-content .skills-subtitle:first-child {
    margin-top: 0;
}

.main-content .hard-skills {
    margin-bottom: 25px;
}

.main-content .skill-category {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.main-content .category-name {
    font-weight: 600;
    color: #3498db;
    margin-bottom: 4px;
}

.main-content .category-items {
    color: #555;
    padding-left: 15px;
}

.main-content .soft-skills {
    margin-top: 20px;
}

.main-content .soft-skills-text {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    margin: 0;
    padding-left: 15px;
}

.main-content {
    padding: 40px 50px;
    background: white;
}

.header-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #3498db;
    text-align: center;
}

.main-name {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.main-title {
    font-size: 20px;
    font-weight: normal;
    color: #7f8c8d;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.main-content h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-content section {
    margin-bottom: 40px;
}

.profile p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.experience-item,
.project-item,
.award-item,
.reference-item,
.certification-item {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #ecf0f1;
}

.experience-item:last-child,
.project-item:last-child,
.award-item:last-child,
.reference-item:last-child,
.certification-item:last-child {
    border-bottom: none;
}

.experience-header,
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.experience-header h3,
.project-header h3 {
    font-size: 20px;
    color: #2c3e50;
    margin: 0;
}

.experience-header .role {
    font-size: 16px;
    color: #7f8c8d;
    font-weight: normal;
}

.project-header .project-date {
    font-size: 14px;
    color: #7f8c8d;
}

.date-range {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 12px;
    font-style: italic;
}

.experience-item p,
.project-item p {
    font-size: 15px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.7;
}

.experience-item ul,
.project-item ul {
    margin-left: 20px;
    margin-top: 10px;
}

.experience-item ul li,
.project-item ul li {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.6;
}

/* Proyectos dentro de experiencia laboral */
.projects-within-experience {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.projects-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.projects-within-experience .project-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #3498db;
    margin-left: 0;
}

.projects-within-experience .project-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.projects-within-experience .project-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.projects-within-experience .project-item p {
    font-size: 14px;
    margin-bottom: 10px;
}

.projects-within-experience .project-item ul {
    margin-top: 8px;
}

.award-item h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.award-item p {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.reference-item h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.reference-item p {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.certification-item {
    padding-bottom: 20px;
}

.certification-institution {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.certification-title {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.6;
}

.certification-date {
    font-size: 13px;
    color: #7f8c8d;
    font-style: italic;
}

.download-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-pdf {
    background: #e74c3c;
    color: white;
}

.btn-pdf:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-ats {
    background: #3498db;
    color: white;
}

.btn-ats:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Botones de generación (ocultos por defecto) */
.generate-buttons {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.btn-generate {
    background: #27ae60;
    color: white;
}

.btn-generate:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Estilos para impresión y PDF */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .download-buttons {
        display: none;
    }
    
    .container {
        box-shadow: none;
    }
}

/* Versión ATS - oculta estilos visuales */
.ats-version {
    background: white;
    color: black;
}

.ats-version .sidebar {
    background: white;
    color: black;
    border-right: 1px solid #ddd;
}

.ats-version .sidebar h3 {
    color: black;
    border-bottom: 1px solid #ddd;
}

.ats-version .main-content h2 {
    color: black;
    border-bottom: 1px solid #ddd;
}

/* Sección de Repositorios - No aparece en PDF/ATS */
.repositories-section {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
    background-color: #f5f5f5;
    min-height: calc(100vh - 100px);
}

.repositories-container {
    background: white;
    padding: 50px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.repositories-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.repositories-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 40px;
}

.repositories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.repository-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.repository-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.repo-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.repo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.repo-image-container:has(.repo-image[src=""])::after,
.repo-image-container:has(.repo-image[src*="placeholder"])::after {
    content: "📁";
    font-size: 48px;
    color: white;
    opacity: 0.7;
}

.repository-card:hover .repo-image {
    transform: scale(1.05);
}

.repo-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.repo-title {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 12px;
    font-weight: 600;
}

.repo-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.repo-report-link {
    display: inline-flex;
    align-items: center;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    margin-top: auto;
}

.repo-report-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Ocultar menú de navegación y sección de repositorios en PDF y ATS */
@media print {
    .main-nav {
        display: none !important;
    }
    .repositories-section {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 70px;
    }
    
    .container {
        margin: 0;
        box-shadow: none;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .top-contact {
        padding: 10px 12px;
        gap: 10px;
        font-size: 11px;
        flex-wrap: wrap;
        justify-content: flex-start;
        overflow-x: auto;
    }
    
    .contact-item-inline {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
    }
    
    .contact-item-inline span {
        word-break: break-word;
        font-size: 10px;
        max-width: 100%;
        overflow-wrap: break-word;
    }
    
    .header-info {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .main-name {
        font-size: 28px;
    }
    
    .main-title {
        font-size: 16px;
    }
    
    .main-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .main-content section {
        margin-bottom: 30px;
    }
    
    .profile p {
        font-size: 14px;
        line-height: 1.7;
    }
    
    .experience-item,
    .project-item,
    .certification-item {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .experience-header h3,
    .project-header h3 {
        font-size: 18px;
    }
    
    .date-range,
    .project-date {
        font-size: 13px;
    }
    
    .experience-item p,
    .project-item p {
        font-size: 14px;
    }
    
    .experience-item ul li,
    .project-item ul li {
        font-size: 13px;
    }
    
    .compact-section {
        margin-top: 15px;
    }
    
    .compact-grid {
        gap: 20px;
    }
    
    .compact-column h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .certification-item-compact {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .cert-institution-compact {
        font-size: 13px;
    }
    
    .cert-title-compact {
        font-size: 12px;
    }
    
    .cert-date-compact {
        font-size: 11px;
    }
    
    .skills-subtitle-compact {
        font-size: 13px;
        margin-top: 12px;
    }
    
    .skill-category-compact {
        font-size: 12px;
    }
    
    .soft-skills-text-compact {
        font-size: 12px;
    }
    
    .education-item-compact {
        font-size: 12px;
    }
    
    .languages-compact p {
        font-size: 12px;
    }
    
    .download-buttons {
        position: relative;
        bottom: auto;
        right: auto;
        justify-content: center;
        margin-top: 20px;
        flex-wrap: wrap;
        padding: 0 15px;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 20px;
        margin: 5px;
    }
    
    .nav-container {
        padding: 12px 15px;
        gap: 15px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 6px 15px;
    }
    
    .repositories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .repositories-container {
        padding: 20px 15px;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
    body {
        padding: 5px;
        padding-top: 65px;
    }
    
    .main-content {
        padding: 15px 10px;
    }
    
    .top-contact {
        padding: 8px 10px;
        gap: 8px;
        font-size: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .contact-item-inline {
        flex: 1 1 100%;
        width: 100%;
        justify-content: flex-start;
    }
    
    .contact-item-inline span {
        font-size: 9px;
        max-width: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .main-name {
        font-size: 24px;
    }
    
    .main-title {
        font-size: 14px;
    }
    
    .main-content h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .main-content section {
        margin-bottom: 25px;
    }
    
    .profile p {
        font-size: 13px;
    }
    
    .experience-header h3,
    .project-header h3 {
        font-size: 16px;
    }
    
    .experience-item p,
    .project-item p {
        font-size: 13px;
    }
    
    .experience-item ul li,
    .project-item ul li {
        font-size: 12px;
    }
    
    .compact-column h2 {
        font-size: 16px;
    }
    
    .cert-institution-compact {
        font-size: 12px;
    }
    
    .cert-title-compact {
        font-size: 11px;
    }
    
    .skills-subtitle-compact {
        font-size: 12px;
    }
    
    .skill-category-compact {
        font-size: 11px;
    }
    
    .btn {
        font-size: 12px;
        padding: 8px 16px;
        width: 100%;
        max-width: 200px;
    }
    
    .nav-container {
        padding: 10px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 13px;
        padding: 5px 12px;
    }
}

