/* ------------------------------ */
/* CONFIGURACIÓN GENERAL */
/* ------------------------------ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f0f9fb; /* Azul muy pálido */
    color: #333;
    line-height: 1.6;
    animation: spinIn 1.2s ease-in-out;
}

/* Transiciones suaves */
body, header, section, footer, figure, form, input, textarea {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* ------------------------------ */
/* ENCABEZADO Y MENÚ */
/* ------------------------------ */

header {
    background-color: #00bcd4; /* Azul turquesa */
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
}

header h1 {
    font-size: 2.5rem;
    letter-spacing: 2px;
}

header h2 {
    font-weight: normal;
    color: #e0f7fa;
}

nav ul {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: #f9f9f9;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: #004d60;
}

/* ------------------------------ */
/* SECCIONES */
/* ------------------------------ */

section {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 1rem;
}

section h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #004d60;
    border-bottom: 2px solid #00bcd4;
    display: inline-block;
    padding-bottom: 0.3rem;
}

/* ------------------------------ */
/* SECCIÓN SOBRE MÍ */
/* ------------------------------ */

#sobre-mi {
    text-align: center;
}

#sobre-mi img {
    margin-top: 1rem;
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #00bcd4;
}

/* ------------------------------ */
/* GALERÍA */
/* ------------------------------ */

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

figure {
    background-color: #eaf6f8;
    border: 1px solid #b5e3ea;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

figure:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

figure img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

figure:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

figcaption {
    padding: 0.8rem;
    font-size: 0.9rem;
    color: #555;
}

/* ------------------------------ */
/* FORMULARIO */
/* ------------------------------ */

form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: bold;
    color: #004d60;
}

input,
textarea {
    padding: 0.7rem;
    border: 1px solid #aaa;
    background-color: #f9f9f9;
    color: #333;
}

button {
    padding: 0.8rem;
    background-color: #00bcd4;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    border-radius: 5px;
    font-weight: bold;
}

button:hover {
    background-color: #008c9e;
}

button:active {
    transform: scale(0.98);
}

/* ------------------------------ */
/* PIE DE PÁGINA */
/* ------------------------------ */

footer {
    background-color: #00bcd4;
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: 3rem;
}

/* ------------------------------ */
/* RESPONSIVE */
/* ------------------------------ */

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    figure img {
        height: 180px;
    }
}

/* ------------------------------ */
/* MENÚ HAMBURGUESA */
/* ------------------------------ */

.menu {
    position: relative;
}

#menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    font-size: 2.5rem;
    color: #00aaff;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 1000;
    transition: color 0.3s;
}

.menu-icon:hover {
    color: #66ccff;
}

.menu-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.2rem;
}

.menu-links a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    transition: color 0.3s, transform 0.2s;
}

.menu-links a:hover {
    color: #004d60;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .menu-icon {
        display: block;
    }

    .menu-links {
        display: none;
        flex-direction: column;
        align-items: center;
        background-color: #0097a7;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 2rem 0;
        border-top: 2px solid #00bcd4;
        gap: 1.5rem;
        font-size: 1.3rem;
        transition: all 0.3s ease;
    }

    #menu-toggle:checked + .menu-icon + .menu-links {
        display: flex;
    }

    .menu-links a:hover {
        color: #004d60;
    }
}

/* ------------------------------ */
/* INTERRUPTOR MODO OSCURO */
/* ------------------------------ */

.switch-container {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.switch-label .switch-btn {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

#modoOscuroToggle {
    display: none;
}

#modoOscuroToggle:checked + .switch-label {
    background-color: #00aaff;
}

#modoOscuroToggle:checked + .switch-label .switch-btn {
    transform: translateX(24px);
}

.switch-text {
    font-size: 1.2rem;
    color: #00aaff;
    font-weight: bold;
}

/* ------------------------------ */
/* MODO OSCURO */
/* ------------------------------ */

body.modo-oscuro {
    background-color: #0b0b0b;
    color: #f1f1f1;
}

body.modo-oscuro header {
    background-color: #000;
}

body.modo-oscuro section {
    background-color: #121212;
    color: #e5e5e5;
}

body.modo-oscuro figure {
    background-color: #1e1e1e;
    border-color: #333;
}

/* ------------------------------ */
/* LIGHTBOX */
/* ------------------------------ */

.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox-img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
}

.lightbox .caption {
    color: #f1f1f1;
    text-align: center;
    font-size: 1rem;
}

.lightbox .cerrar {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox .cerrar:hover {
    color: #00bcd4;
}

/* ------------------------------ */
/* ANIMACIÓN SPIN-IN */
/* ------------------------------ */

@keyframes spinIn {
  0% {
    opacity: 0;
    transform: rotate(-360deg) scale(0);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* ------------------------------ */
/* PANTALLA DE CARGA */
/* ------------------------------ */

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #00bcd4, magenta);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeOut 1s ease forwards;
  animation-delay: 2.5s;
}

.spinner {
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top: 6px solid #fff;
  border-right: 6px solid #ff00aa;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loader-text {
  color: #fff;
  font-size: 1.6rem;
  font-weight: bold;
  animation: spinIn 1.2s ease-in-out;
}

/* Animación del spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Desvanecer loader */
@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}




