/* Resetear márgenes y paddings por defecto */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Establecer fuente y estructura base */
body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
    color: #000000;
    transition: background-color 0.3s ease, color 0.3s ease;
}

main {
    flex: 1;
}

/* Header fijo */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000000;
    color: #FFFFFF;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu li a:hover {
    color: #4FC3F7;
}

.nav-menu li button {
    background-color: transparent;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-menu li button:hover {
    background-color: #4FC3F7;
    color: #000000;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #FFFFFF;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

section {
    width: 100%;
    min-height: 100vh;
    padding: 80px 20px;
    background-color: #FFFFFF;
    color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

section > * {
    max-width: 1200px;
    width: 100%;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

#about-me {
    justify-content: center;
}

#about-me > * {
    max-width: 800px;
    width: 100%;
}

#about-me h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#about-me p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify;
}

#about-me p strong {
    color: #4FC3F7;
    font-weight: 700;
}

#skills {
    justify-content: flex-start;
}

#skills h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#skills p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.skills-category {
    background-color: #F9F9F9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: left;
    transition: background-color 0.3s ease;
}

.skills-category h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skills-list {
    list-style: none;
}

.skills-list li {
    font-size: 1rem;
    line-height: 1.5;
    color: #333333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.skill-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.skill-logo:hover {
    transform: scale(1.2);
}

#projects {
    justify-content: flex-start;
}

#projects h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#projects p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.project-filters .filter-btn {
    background-color: #F5F5F5;
    color: #000000;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.project-filters .filter-btn:hover,
.project-filters .filter-btn.active {
    background-color: #4FC3F7;
    color: #FFFFFF;
}

.project-category {
    margin-bottom: 40px;
}

.project-category h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-category h4 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333333;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.project-card {
    background-color: #F9F9F9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: left;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.project-images img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 5px;
    cursor: pointer;
}

.project-card > img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 15px;
    cursor: pointer;
}

.project-card h5 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.project-card p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: left;
}

.project-card ul {
    list-style: none;
    margin-bottom: 15px;
}

.project-card ul li {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333333;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.project-card .related-tag {
    background-color: #4FC3F7;
    color: #FFFFFF;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-card a {
    background-color: #4FC3F7;
    color: #FFFFFF;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.project-card a:hover {
    background-color: #0288D1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #FFFFFF;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #4FC3F7;
}

#education {
    justify-content: flex-start;
}

#education h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#education p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.education-entry {
    margin-bottom: 40px;
}

.education-entry h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.academic-entry {
    background-color: #F9F9F9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    transition: background-color 0.3s ease;
}

.academic-entry h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4FC3F7;
}

.academic-entry p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #333333;
    text-align: left;
}

.academic-entry ul {
    list-style: none;
    margin-bottom: 10px;
}

.academic-entry ul li {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #000000;
    position: relative;
    padding-left: 20px;
}

.academic-entry ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #4FC3F7;
    font-size: 1.2rem;
}

.language-entry {
    margin-bottom: 20px;
}

.language-entry h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-entry ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.language-entry ul li {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #000000;
}

.language-entry ul li strong {
    color: #4FC3F7;
    font-weight: 600;
}

#contact {
    justify-content: center;
}

#contact > * {
    max-width: 800px;
    width: 100%;
}

#contact h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#contact p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

#contact form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-column {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.form-row label,
.form-column label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #000000;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #CCCCCC;
    border-radius: 5px;
    background-color: #F9F9F9;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #4FC3F7;
    box-shadow: 0 0 5px rgba(79, 195, 247, 0.3);
}

.form-row textarea {
    resize: vertical;
    min-height: 120px;
}

.form-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.form-buttons button {
    background-color: #4FC3F7;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-buttons button:hover {
    background-color: #0288D1;
}

.form-buttons button[type="reset"] {
    background-color: #CCCCCC;
    color: #000000;
}

.form-buttons button[type="reset"]:hover {
    background-color: #AAAAAA;
}

footer {
    width: 100%;
    background-color: #000000;
    color: #FFFFFF;
    padding: 20px 0;
}

footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

footer .footer-links h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

footer .footer-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

footer .footer-links ul li {
    margin: 0 15px;
}

footer .footer-links ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

footer .footer-links ul li a:hover {
    color: #4FC3F7;
}

footer .footer-copyright {
    margin-top: 10px;
}

footer .footer-copyright p {
    font-size: 0.9rem;
}

.language-menu {
    position: relative;
}

.language-btn {
    background-color: transparent;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.language-btn:hover {
    background-color: #4FC3F7;
    color: #000000;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #000000;
    border: 1px solid #FFFFFF;
    border-radius: 5px;
    list-style: none;
    padding: 10px 0;
    z-index: 1000;
}

.language-dropdown.active {
    display: block;
}

.language-dropdown li {
    margin: 0;
}

.language-dropdown button {
    background-color: transparent;
    color: #FFFFFF;
    border: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.language-dropdown button:hover {
    background-color: #4FC3F7;
    color: #000000;
}

/* Tema oscuro */
body.dark-theme {
    background-color: #000000;
    color: #FFFFFF;
}

body.dark-theme section {
    background-color: #111111;
    color: #FFFFFF;
}

body.dark-theme #about-me p {
    color: #FFFFFF;
}

body.dark-theme .skills-category {
    background-color: #222222;
}

body.dark-theme .skills-category h3 {
    color: #FFFFFF;
}

body.dark-theme .skills-list li {
    color: #CCCCCC;
}

body.dark-theme .project-filters .filter-btn {
    background-color: #333333;
    color: #FFFFFF;
}

body.dark-theme .project-filters .filter-btn:hover,
body.dark-theme .project-filters .filter-btn.active {
    background-color: #4FC3F7;
    color: #FFFFFF;
}

body.dark-theme .project-category h4 {
    color: #CCCCCC;
}

body.dark-theme .project-card {
    background-color: #222222;
}

body.dark-theme .project-card p,
body.dark-theme .project-card ul li {
    color: #CCCCCC;
}

body.dark-theme .academic-entry {
    background-color: #222222;
}

body.dark-theme .academic-entry p {
    color: #CCCCCC;
}

body.dark-theme .academic-entry ul li {
    color: #FFFFFF;
}

body.dark-theme .language-entry ul li {
    color: #FFFFFF;
}

body.dark-theme .form-row label,
body.dark-theme .form-column label {
    color: #FFFFFF;
}

body.dark-theme .form-row input,
body.dark-theme .form-row textarea {
    background-color: #333333;
    color: #FFFFFF;
    border-color: #555555;
}

body.dark-theme .form-row input:focus,
body.dark-theme .form-row textarea:focus {
    border-color: #4FC3F7;
    box-shadow: 0 0 5px rgba(79, 195, 247, 0.3);
}

body.dark-theme .form-buttons button[type="reset"] {
    background-color: #555555;
    color: #FFFFFF;
}

body.dark-theme .form-buttons button[type="reset"]:hover {
    background-color: #777777;
}

/* Media Queries para móviles */
@media (max-width: 768px) {
    header {
        min-height: 70px;
        padding: 20px 0;
    }

    .menu-toggle {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1100;
        width: 40px;
        height: 30px;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #000000;
        flex-direction: column;
        padding: 20px 0;
        text-align: center;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 15px 0;
    }

    .nav-menu li a,
    .nav-menu li button {
        font-size: 1.2rem;
    }

    #about-me h2,
    #skills h2,
    #projects h2,
    #education h2,
    #contact h2 {
        font-size: 2rem;
    }

    #about-me p,
    #skills p,
    #projects p,
    #education p,
    #contact p {
        font-size: 1rem;
    }

    .skills-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .skills-category {
        padding: 15px;
    }

    .skills-category h3 {
        font-size: 1.4rem;
    }

    .skills-list li {
        font-size: 0.9rem;
    }

    .skill-logo {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .skill-logo:hover {
        transform: none;
    }

    .project-filters {
        gap: 8px;
    }

    .project-filters .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .project-category h3 {
        font-size: 1.6rem;
    }

    .project-category h4 {
        font-size: 1.2rem;
    }

    .project-card {
        padding: 15px;
    }

    .project-card > img {
        max-height: 300px;
    }

    .project-images img {
        max-height: 150px;
    }

    .project-card h5 {
        font-size: 1.1rem;
    }

    .project-card p,
    .project-card ul li {
        font-size: 0.9rem;
    }

    .project-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .project-card .related-tag {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .project-card a {
        font-size: 0.9rem;
        padding: 6px 12px;
        width: 100%;
        text-align: center;
    }

    .education-entry h3,
    .language-entry h3 {
        font-size: 1.6rem;
    }

    .academic-entry {
        padding: 15px;
    }

    .academic-entry h4 {
        font-size: 1.2rem;
    }

    .academic-entry p,
    .language-entry ul li {
        font-size: 0.9rem;
    }

    .form-column {
        min-width: 100%;
    }

    .form-row input,
    .form-row textarea {
        font-size: 0.9rem;
    }

    .form-buttons button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    footer .footer-links h3 {
        font-size: 1.3rem;
    }

    footer .footer-links ul li {
        margin: 5px 10px;
    }

    footer .footer-links ul li a {
        font-size: 0.9rem;
    }

    footer .footer-copyright p {
        font-size: 0.8rem;
    }

    .language-dropdown {
        position: static;
        border: none;
        background-color: transparent;
        padding: 0;
    }

    .language-dropdown.active {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .language-dropdown button {
        font-size: 1.2rem;
        padding: 10px;
        text-align: center;
    }
}