* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    background-color: #f7f7f7;
    color: #333;
    line-height: 1.6;
    padding-top: 80px;
}

body.dark {
    background-color: #121212;
}

/* Header */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

body.dark header {
    background-color: #1A1A1A;
    border-bottom: 1px solid #000000;
}

.logo-container {
    flex-shrink: 0;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    filter: invert(1);
}

body.dark .logo {
    filter: none;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

nav ul li {
    display: inline-block;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 30px;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;   
}

body.dark nav ul li a {
    color: white;
}

nav ul li a:hover {
    background-color: #007bff;
    color: #ffffff;
}

/* Gear Container */
.gear-container {
    position: relative;
}

#gear-btn {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease, transform 0.3s ease;
}

#gear-btn:hover {
    transform: rotate(90deg);
}

body.dark #gear-btn {
    color: #ffffff;
}

/* Settings Menu */
.settings-menu {
    display: none;
    position: absolute;
    top: 3em;
    right: 1em;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: fadeIn 0.3s ease forwards;
}

body.dark .settings-menu {
    background-color: #161616;
}

.settings-menu.active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-menu button {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.settings-menu button:hover {
    background-color: #007BFF;
    color: #ffffff;
}

.language-switch {
    display: inline-block;
    width: 100%;
    text-align: center;
}

/* Language Toggle */
#language-toggle {
    background-color: #ffffff;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#language-toggle:hover {
    background-color: #007BFF;
    color: #ffffff;
}

/* Switch */
.switch {
    border: none;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    height: 30px;
    padding: 5px;
    border-radius: 2em;
    outline: none;
    margin: 0 auto;
    background-color: #f0f0f0;
  }
  
  .switch::after {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), background-color 0.3s ease;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
  }
  
  .switch.active {
    background-color: #ebebeb;
    color: #007BFF;
  }
  
  .switch.active::after {
    transform: translateY(-50%) translateX(30px) scale(1.1);
    background-color: #ffffff;
  }
  
  .switch span {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007BFF;
  }
  
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 24px;
    margin-left: 1em;
}

.aboutme {
    text-align: center;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.aboutme h1, .aboutme .desc, .download-btn {
    z-index: 3;
}

.aboutme img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.aboutme img:hover {
    transform: scale(1.1);
}

.aboutme .desc {
    max-height: none;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    font-size: 1.1rem;
    margin-top: 20px;
    color: #333;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
}

body.dark .aboutme .desc {
    color: #ddd;
}

.aboutme:hover .desc {
    transform: scale(1.02);
}

.download-btn {
    display: inline-block;
    margin: 10px 5px;
}

.download-btn button {
    background-color: #007BFF;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-bottom: 0;
}

.download-btn button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Estrellas */
.star {
    position: absolute;
    top: -10px;
    width: 3px;
    height: 3px;
    background: #007bff62;
    border-radius: 50%;
    opacity: 0.8;
    animation: animStar var(--duration) linear infinite;
}

@keyframes animStar {
    0% {
        transform: translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateY(75vh);
        opacity: 1;
    }
}

.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* Projects */

.projects {
    text-align: center;
    background-color: #f7f7f7;
    margin-bottom: 4em;
    margin-top: 2em;
}

body.dark .projects {
    background-color: #121212;
}

h1 {
    font-size: 2rem;
    color: #333;
}

h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #007bff;
}

body.dark p,
body.dark h1,
body.dark h2 {
    color: #fff;
}

.projects-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin: 0 auto;
    max-width: 1200px;
}

.project {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    max-width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
    flex: 1 1 calc(33.333% - 40px);
    margin: 10px;
    box-sizing: border-box;
}

body.dark .project {
    background-color: #1d1d1d;
}

.project:hover {
    transform: translateY(-10px);
}

.project-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.projects-container .web a {
    font-size: 2rem;
    color: #000;
    transition: transform 0.3s ease, color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin: 0 10px;
}

body.dark .projects-container .web a {
    color: #fff;
}

body.dark .projects-container .web a:hover,
.projects-container .web a:hover {
    transform: scale(1.2);
    color: #007bff;
}

p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

/* Estudios */

.studies {
    background-color: #f7f7f7;
    text-align: center;
    margin-bottom: 4em;
}

body.dark .studies {
    background-color: #121212;
}

.studies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.study-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    max-width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s ease;
}

body.dark .study-item {
    background-color: #1d1d1d;
}

.study-item p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 10px;
}

.study-item span {
    display: block;
    font-size: 0.9rem;
    color: #999;
}

.study-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.technologies {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: left;
}

.technologies i {
    font-size: 24px;
    color: #333;
    transition: color 0.3s ease;
}

body.dark .technologies i {
    color: #ddd;
}

body.dark .technologies i:hover,
.technologies i:hover {
    color: #007bff;
}

/* Footer */

.footer {
    background-color: #ffffff;
    border-top: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

body.dark .footer {
    background-color: #1A1A1A;
    border-top: 1px solid #353535;
}

.socialIcons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.contact-title {
    margin-bottom: 10px;
}

.contact-title h4 {
    font-size: 1.2rem;
    font-weight: bold;
}

body.dark .contact-title h4 {
    color: #ddd;
}

.icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.icons a {
    color: #000000;
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s ease;
}

body.dark .icons a {
    color: #ddd;
}

body.dark .icons a:hover,
.icons a:hover {
    color: #007bff;
}

.footer::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: #444;
    margin-bottom: 20px;
}

.footer-bottom {
    margin-top: 20px;
    font-size: 0.875rem;
    color: #bbb;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
}

.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: rgba(255, 255, 255, 0.6);
    animation: fall linear infinite, sway ease-in-out infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

@keyframes sway {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Pantallas pequeñas */

@media screen and (max-width: 768px) {

    body {
        margin-top: 1.5em; 
        overflow-x: hidden;
    }

    header {
        padding: 10px 20px;
        justify-content: space-between;
    }

    h1 {
        padding: 10px;
    }

    .logo-container {
        justify-content: center;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    nav ul {
        display: none;
        gap: 1px;
        flex-direction: wrap;
        align-items: center;
        background-color: #ffffff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        position: absolute;
        top: 60px;
        justify-content: center;
        right: 0;
        width: 100%;
        height: 4em;
    }

    body.dark nav ul {
        background-color: #1A1A1A;
    }

    nav ul li a {
        font-size: 14px;
        padding: 12px;
    }

    .settings-menu {
        margin-right: -4em;
    }

    .menu-toggle {
        display: block;
    }

    body.dark .menu-toggle {
        color: #ddd;
    }

    nav ul.active {
        display: flex;
    }

    .projects-container {
        flex-direction: column;
        align-items: center;
        gap: 1em;
    }

    .project {
        flex: 1 1 100%;   
        max-width: 22em;
    }
        .aboutme .desc {
        font-size: 0.9rem;
        width: 90%;
        line-height: 1.5;
    }

}