/* Variables   */
:root {
    --bg-color: #f0f2f5;
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.9);
    --accent-color: #007bff;
    --nav-bg: #333;
    --nav-text: #fff;
    --input-bg: #fff;
    --border-color: #ddd;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Modo Oscuro */
body.dark-mode {
    --bg-color: #0d1117;
    --text-color: #e6e6e6;
    --card-bg: rgba(22, 27, 34, 0.85);
    --accent-color: #58a6ff;
    --nav-bg: rgba(0, 0, 0, 0.8);
    --nav-text: #f0f6fc;
    --input-bg: #0d1117;
    --border-color: #30363d;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border_box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}



/* --- Navegación --- */
header {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
}

nav h1 {
    color: var(--nav-text);
    margin: 0;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--nav-text);
    z-index: 1001;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

/*   Switch  */
.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input { display: none; }

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

.sun-icon { color: #f39c12; font-size: 14px; margin-left: 5px; }
.moon-icon { color: #f1c40f; font-size: 14px; margin-right: 5px; }

input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); }



.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 20px;
}

.glass-effect {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}
/*  Secciones*/
.about-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.bio-text { flex: 2; }
.bio-photo { flex: 1; text-align: center; }

.bio-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 2rem;
    text-align: center;
    margin-top: 1.5rem;
}
.tech-item { transition: transform 0.3s; }
.tech-item:hover { transform: translateY(-10px); }
.tech-item i { font-size: 3.5rem; margin-bottom: 0.5rem; }

/* --- Carrusel */
.hobbies-section {
    position: relative;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.slide-caption {
    position: absolute;
    top: 0;
    left: 0;
    right: 0; 
    bottom: 0; 
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    color: #fff;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slide-caption h4 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-caption p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto; 
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Hover effect */
.carousel-slide:hover .slide-caption {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 10;
}
.carousel-btn:hover { background: var(--accent-color); }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* --- Formulario --*/
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; }

.form-group input, 
.form-group textarea {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    border-radius: 8px;
    font-size: 1rem;
}

.submit-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    transition: transform 0.2s;
}
.submit-btn:hover { transform: scale(1.02); }

/* Alertas */
.alert { padding: 15px; margin-bottom: 1rem; border-radius: 8px; font-weight: bold; }
.alert.success { background-color: rgba(212, 237, 218, 0.8); color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background-color: rgba(248, 215, 218, 0.8); color: #721c24; border: 1px solid #f5c6cb; }

@media (max-width: 768px) {
    .hamburger { display: block; }

    
    nav ul {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(15px);
        width: 100%;
        height: 100vh;
        justify-content: center;
        transition: 0.4s ease;
        z-index: 1000;
    }

    nav ul.active { left: 0; }
    nav ul li { margin: 20px 0; }
    nav ul li a { font-size: 1.5rem; }

    .about-section {
        flex-direction: column; 
        text-align: left;
    }
    .bio-photo { margin-top: 1.5rem; }
    .carousel-container { height: 300px; }
    
    .slide-caption h4 { font-size: 1.8rem; }
    .slide-caption p { font-size: 1rem; }


    .slide-caption {
        padding: none !important; 
        justify-content: center;
        text-align: center; 
    }

    .carousel-btn {
        top: auto;        
        bottom: 10px;     
        transform: none;  
        padding: 10px;
        background: rgba(0,0,0,0.3); 
    }
        .prev-btn { left: 30%; } 
    .next-btn { right: 30%; }
}

p{
    margin-bottom: 2rem;
}


h2{
    margin-bottom: 2rem;
}
