/* General */
body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background: url('../img/gradient.svg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
}

/* Container */

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 280px;
    /* background-color: #ffffff; */
    padding: 20px;
    /* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); */
    display: flex;
    flex-direction: column;
}

.avatar-box {
    text-align: center;
    margin-bottom: 20px;
}

.avatar-box img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.avatar-box h1 {
    margin: 0;
    font-size: 1.2em;
}

.sidebar nav ul {
    list-style-type: none;
    padding: 0;
}

.sidebar nav ul li {
    margin-bottom: 10px;
}

.sidebar nav ul li a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 10px;
    transition: background-color 0.3s, border-right 0.3s;
    background-color: #ffffff;
    box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
    border-left: 3px solid transparent;
}

.sidebar nav ul li a:hover {
    background-color: #f0f0f0;
    border-left: 3px solid #0067b8;
}

.sidebar nav ul li .icon-box:hover {
    color: #0067b8;
}

.contacto {
    margin-top: auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
}

.contacto li {
    list-style-type: none;
}

.contacto ion-icon {
    padding-right: 10px;
}

.contacto a {
    display: block;
    color: #0067b8;
    text-decoration: none;
    margin-bottom: 10px;
    padding: 5px 0;
}

.social-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.social-links a {
    margin: 0 10px;
    font-size: 24px;
    color: #0067b8;
}

/* Contenedor Principal */

.main-content {
    flex: 1;
    padding: 20px;
    /* background-color: #f9f9f9; */
}

.card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
    color: #0067b8;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.card h3 {
    margin-bottom: 5px;
}

.card p {
    padding-bottom: 3px;
}

.card li {
    padding-bottom: 5px;
}

/* Proyectos */

.project-container {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
    gap: 20px;
    /* Espacio entre las tarjetas */
}

.project-card {
    width: 200px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    /* Para que la imagen no sobresalga */
    box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
    /* Sombra de la tarjeta */
    perspective: 1000px;
    /* Para el efecto 3D */
    padding: 5px;
    transition: transform 0.3s;
    /* Añadir transición para suavizar el efecto */
}

.project-card:hover {
    transform: scale(1.04);
    /* Aumentar el tamaño al 102% */
}

.card-inner {
    position: relative;
    width: 200px;
    height: 300px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
}

.card-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    /* Altura fija para el cuerpo de la tarjeta */
}

.card-body img {
    width: 200px;
    /* Ancho de la imagen */
    height: auto;
    /* Altura automática */
    object-fit: cover;
    /* Asegura que la imagen cubra el área */
}

.card-footer {
    padding: 10px;
    text-align: center;
    /* Centra el texto en el pie de la tarjeta */
}

.project-card h3 {
    color: #0067b8;
    /* Hereda el color del texto, sin cambio de color */
    text-decoration: none;
    /* Elimina el subrayado */
}

.project-card.active .card-inner {
    transform: rotateY(180deg);
    /* Rota la tarjeta al hacer clic */
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    /* Oculta la parte trasera cuando no está visible */
}

.card-back {
    transform: rotateY(180deg);
    /* Rota la parte trasera */
    backface-visibility: hidden;
    /* Oculta la parte trasera cuando no está visible */
    display: flex;
    /* Asegura que el contenido esté centrado */
    justify-content: center;
    /* Centra horizontalmente */
    align-items: center;
    /* Centra verticalmente */
}

.card-back img {
    width: 100%;
    /* Asegura que la imagen ocupe todo el espacio */
    height: auto;
    /* Mantiene la proporción de la imagen */
    transform: scaleX(1);
    /* Invierte la imagen verticalmente */
    object-fit: cover;
    /* Asegura que la imagen cubra el área sin distorsionarse */
}

/* certificados */

.cert-container {
    display: flex;
    overflow: hidden;
    position: relative;
    border-radius: 10px;

}

.dg-container {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
    perspective: 1200px;
    padding: 0;
    /* Adds depth for 3D effect */
}

.dg-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    /* Ensures 3D transforms are preserved */
}

.dg-wrapper a {
    color: #333;
    text-decoration: none;
    display: block;
    position: absolute;
    top: 45%;
    /* Ajusta la posicion vertical de las imagenes */
    left: 50%;
    width: 350px;
    /* Ancho de imagen */
    height: 225px;
    /* Alto de imagen */
    margin-top: -112.5px;
    /* Mitad del alto para el centrado */
    margin-left: -175px;
    /* Mitad del ancho para el centrado */
    opacity: 0;
    visibility: hidden;
    transform-style: preserve-3d;
}

.dg-wrapper a img {
    width: 350px;
    /* Set a fixed width */
    height: 230px;
    /* Set a fixed height */
    object-fit: cover;
    /* Ensures the image fills the area without distortion */
    box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
    border-radius: 10px;
}

.dg-center {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateZ(200px) rotateY(0deg) !important;
    /* Brings the center card forward */
}

.dg-left {
    transform: translateX(-300px) translateZ(-200px) rotateY(45deg);
    /* Position to the left and tilt */
    opacity: 1;
    visibility: visible;
}

.dg-right {
    transform: translateX(300px) translateZ(-200px) rotateY(-45deg);
    /* Position to the right and tilt */
    opacity: 1;
    visibility: visible;
}

.dg-outleft,
.dg-outright {
    transform: translateZ(-400px);
    /* Cards that are out of view */
    opacity: 0;
    visibility: hidden;
}

.dg-transition {
    transition: all 0.6s ease-in-out;
}

.dg-prev,
.dg-next {
    background-color: rgba(0, 123, 255, 0.7);
    /* Color de fondo con transparencia */
    color: white;
    /* Color del texto */
    border: none;
    /* Sin borde */
    width: 40px;
    /* Ancho del botón */
    height: 40px;
    /* Alto del botón */
    border-radius: 50%;
    /* Hace que el botón sea circular */
    cursor: pointer;
    /* Cambia el cursor al pasar el mouse */
    position: absolute;
    /* Posiciona los botones de forma absoluta */
    top: 50%;
    /* Centra verticalmente */
    transform: translateY(-50%);
    /* Ajusta el centrado */
    display: flex;
    /* Para centrar el ícono */
    align-items: center;
    /* Centra verticalmente el ícono */
    justify-content: center;
    /* Centra horizontalmente el ícono */
    z-index: 10;
    /* Asegura que los botones estén por encima de las imágenes */
}

.dg-prev {
    left: 10px;
    /* Posición a la izquierda */
}

.dg-next {
    right: 10px;
    /* Posición a la derecha */
}

.dg-prev:hover,
.dg-next:hover {
    background-color: rgba(0, 105, 217, 0.9);
    /* Color de fondo al pasar el mouse */
}

/* Lenguajes */

.language-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.language-card {
    background-color: #ffffff;
    border-radius: 10px;
    /* box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px; */
    padding: 20px;
}

.language-card h3 {
    color: #0067b8;
    margin-bottom: 15px;
    margin-top: 0px;
    font-size: 1.2em;
}

.language-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.language-item {
    display: flex;
    align-items: center;
    padding-bottom: 13px;
}

.language-item img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.language-info {
    flex-grow: 1;
}

.language-info h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 8px;
    border-radius: 10px;
}

/* Colores específicos para cada barra de progreso */

.progress-bar.html {
    background-color: #ed3d3b;
}

.progress-bar.css {
    background-color: #1e8bcd;
}

.progress-bar.js {
    background-color: #F7DF1E;
}

.progress-bar.wordpress {
    background-color: #0e638b;
}

.progress-bar.python {
    background-color: #fb983b;
}

.progress-bar.django {
    background-color: #18ab50;
}

.progress-bar.postgresql {
    background-color: #336791;
}

.progress-bar.sqlite {
    background-color: #1e8bcd;
}

.progress-bar.MySql {
    background-color: #F7DF1E;
}

.progress-bar.git {
    background-color: #F05032;
}

.progress-bar.github {
    background-color: #a846b2;
}

/* tests psicologicos */

.tests-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tests-card {
    background-color: #ffffff;
    border-radius: 10px;
    /* box-shadow: rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px; */
    padding: 20px;
}

.tests-card h3 {
    color: #0067b8;
    margin-bottom: 15px;
    margin-top: 0px;
    font-size: 1.2em;
}

.tests-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tests-item {
    display: flex;
    align-items: center;
    padding-bottom: 13px;
}


/* colapsable */

.section-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.arrow {
    color: #605e5c;
    font-size: 16px;
    transition: transform 0.1s linear;
}

.collapsible-section.collapsed .arrow {
    transform: rotate(180deg);
}

.section-content {
    /* max-height: 1200px; */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-section.collapsed .section-content {
    max-height: 0;
}

/* Boton principal */

.button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.main-button,
.secondary-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    font-size: 20px;
}

.main-button {
    background-color: #0067b8;
    z-index: 2;
}

.secondary-button {
    background-color: #0067b8;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s, transform 0.3s;
}

.whatsapp-button {
    background-color: #25D366;
}

.phone-button {
    background-color: #0067b8;
}

.main-button:hover,
.secondary-button:hover {
    transform: scale(1.1);
}

.main-button.active {
    transform: rotate(45deg);
    background-color: #004a90;
}

.main-button.active~.secondary-button {
    opacity: 1;
    transform: scale(1);
}

/* Estilos para el modo oscuro */

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .card {
    background-color: #2c2c2c;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 8px 0px, rgba(0, 0, 0, 0.3) 0px 1px 3px 0px;
    border: 1px solid #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .sidebar {
    background-color: transparent;
    box-shadow: none;
}

body.dark-mode .sidebar nav ul li a {
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px 0px;
}

body.dark-mode .sidebar nav ul li a:hover {
    background-color: #3a3a3a;
    border-left-color: #4da3ff;
}

body.dark-mode .card h2 {
    color: #4da3ff;
    border-bottom-color: #333;
}

body.dark-mode .contacto {
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px 0px;
}

body.dark-mode .contacto a {
    color: #4da3ff;
}

body.dark-mode .progress-container {
    background-color: #3a3a3a;
}

body.dark-mode .main-content {
    background-color: transparent;
}

body.dark-mode .language-card {
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px 0px;
}

body.dark-mode .phone-button {
    background-color: #4da3ff;
}

body.dark-mode .tests-card {
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px 0px;
}

body.dark-mode .tests-card h3 {
    color: #4da3ff;
}

/* Estilos de tarjetas de proyectos en modo oscuro */

body.dark-mode .project-card {
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 6px 0px, rgba(0, 0, 0, 0.3) 0px 1px 3px 0px;
}

body.dark-mode .project-card:hover {
    box-shadow: rgba(0, 0, 0, 0.6) 0px 4px 12px 0px, rgba(77, 163, 255, 0.3) 0px 0px 8px 0px;
}

body.dark-mode .card-front,
body.dark-mode .card-back {
    background-color: #2c2c2c;
}

body.dark-mode .card-footer {
    background-color: #252525;
    color: #e0e0e0;
    border-top: 1px solid #3a3a3a;
}

body.dark-mode .project-card h3 {
    color: #4da3ff;
}

body.dark-mode .card-body {
    background-color: #252525;
}

body.dark-mode .progress-container {
    background-color: #3a3a3a;
}

body.dark-mode .language-item {
    border-bottom: 1px solid #3a3a3a;
}

body.dark-mode .language-info h4 {
    color: #e0e0e0;
}

body.dark-mode .dg-prev,
body.dark-mode .dg-next {
    background-color: rgba(77, 163, 255, 0.7);
}

body.dark-mode .dg-prev:hover,
body.dark-mode .dg-next:hover {
    background-color: rgba(77, 163, 255, 0.9);
}

body.dark-mode .dg-wrapper a {
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px 0px;
}

body.dark-mode .dg-wrapper a:hover {
    border-color: #4da3ff;
    box-shadow: rgba(77, 163, 255, 0.2) 0px 0px 8px 0px;
}

body.dark-mode .dg-wrapper a div {
    background-color: rgba(37, 37, 37, 0.95);
    color: #e0e0e0;
}

body.dark-mode .avatar-box h1,
body.dark-mode .avatar-box p {
    color: #e0e0e0;
}

body.dark-mode .icon-box {
    color: #e0e0e0;
}

body.dark-mode .section-header {
    color: #e0e0e0;
}

body.dark-mode .arrow i {
    color: #4da3ff;
}

body.dark-mode p,
body.dark-mode li,
body.dark-mode h3,
body.dark-mode h4 {
    color: #e0e0e0;
}

body.dark-mode a {
    color: #4da3ff;
}

body.dark-mode .job {
    border-left-color: #4da3ff;
}

body.dark-mode .tests-card ul {
    color: #e0e0e0;
}

body.dark-mode .tests-card p {
    color: #e0e0e0;
}

body.dark-mode .tests-card strong {
    color: #4da3ff;
}

/* Asegurar que todos los elementos dentro de .card sean visibles */
body.dark-mode .card p,
body.dark-mode .card li,
body.dark-mode .card h3,
body.dark-mode .card h4,
body.dark-mode .card ul,
body.dark-mode .card ol,
body.dark-mode .card div {
    color: #e0e0e0;
}

body.dark-mode .card strong {
    color: #4da3ff;
}

body.dark-mode .cert-container,
body.dark-mode .dg-container {
    background-color: transparent;
}

body.dark-mode .social-links a {
    color: #4da3ff;
}

body.dark-mode .social-links a:hover {
    color: #6cb5ff;
}

body.dark-mode .main-button {
    background-color: #4da3ff;
}

body.dark-mode .secondary-button {
    background-color: #4da3ff;
}

body.dark-mode .whatsapp-button {
    background-color: #25D366;
}

body.dark-mode .main-button:hover,
body.dark-mode .secondary-button:hover {
    background-color: #3d8fd9;
}

body.dark-mode .main-button.active {
    background-color: #3d8fd9;
}

body.dark-mode #scrollTopButton:hover {
    background-color: #3d8fd9;
}

body.dark-mode #darkModeToggle {
    background-color: #4da3ff;
}

body.dark-mode #darkModeToggle:hover {
    background-color: #3d8fd9;
}

/* Media Query */

@media (max-width: 768px) {
    * {
        margin: 0;
        border: 0;
    }

    .container {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .sidebar {
        order: 1;
        width: 100%;
        padding: 20px;
    }

    .sidebar .nav {
        padding: 20px;
    }

    .sidebar nav ul {
        padding: 20px;
    }

    .sidebar .contacto {
        margin: 20px;
    }

    .main-content {
        order: 2;
    }

    .card h2 {
        margin-bottom: 10px;
    }

    .card p {
        margin-bottom: 10px;
    }

    .card ul {
        margin-bottom: 10px;
    }

    .project-container {
        justify-content: center;
    }

    .project-card {
        flex: 0 1 auto;
        margin-top: 20px;
    }

    .job {
        padding-top: 15px;
    }

    #formacion-academica h2 {
        padding-bottom: 15px;
    }

    #formacion-academica h3 {
        padding-top: 15px;
    }

    #formacion-academica li {
        padding-top: 15px;
    }

    #habilidades h2 {
        padding-bottom: 15px;
    }

    #habilidades li {
        padding-top: 15px;
    }

    #idiomas h2 {
        padding-bottom: 15px;
    }

    #idiomas li {
        padding-top: 15px;
    }

    #lenguajes h2 {
        padding-bottom: 15px;
    }

    .language-grid {
        padding-top: 15px;
    }
}