/* =========================================
   VARIABLES Y ESTILOS BASE
========================================= */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --primary-color: #1e293b;
    --accent-color: #0284c7;
    --bg-color: #f8fafc;
    --text-color: #334155;
    --card-bg: #ffffff;
}

html {
    scroll-behavior: smooth; /* Para que el menú navegue suavemente */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    transition: background-color 0.3s, color 0.3s;
}

/* =========================================
   BARRA LATERAL (Sidebar)
========================================= */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    z-index: 100;
}

.sidebar-profile {
    text-align: center;
    margin-bottom: 30px;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-bottom: 15px;
}

.sidebar-profile h1 {
    color: #ffffff;
    font-size: 1.5em;
    margin-bottom: 5px;
}

.sidebar-profile h2 {
    font-size: 0.9em;
    color: var(--accent-color);
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: auto; /* Empuja lo demás hacia abajo */
}

.sidebar-nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar-nav a:hover {
    background-color: rgba(255,255,255,0.1);
    color: #ffffff;
}

.sidebar-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.control-btn {
    background: transparent;
    color: var(--sidebar-text);
    border: 1px solid var(--sidebar-text);
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.control-btn:hover {
    background: var(--sidebar-text);
    color: var(--sidebar-bg);
}

.sidebar-social {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.logo-icon:hover {
    opacity: 1;
}

/* =========================================
   CONTENIDO PRINCIPAL
========================================= */
.main-content {
    margin-left: 280px; /* Deja espacio para la barra lateral */
    padding: 60px;
    width: calc(100% - 280px);
    max-width: 1000px;
}

.content-section {
    margin-bottom: 50px;
}

.content-section h3 {
    color: var(--primary-color);
    font-size: 2em;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
    display: inline-block;
}

.contact-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: var(--accent-color);
    flex-wrap: wrap;
}

.about-text {
    text-align: justify;
    font-size: 1.1em;
}

/* =========================================
   TARJETAS DE EXPERIENCIA (Cards)
========================================= */
.experience-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.experience-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-header h4 {
    color: var(--primary-color);
    font-size: 1.2em;
}

.badge {
    background-color: var(--accent-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

/* =========================================
   GRID DE HABILIDADES (CON LOGOS)
========================================= */
.skills-category {
    margin-bottom: 35px;
}

.skills-category h4 {
    color: var(--primary-color);
    font-size: 1.15em;
    margin-bottom: 20px;
    font-weight: 600;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 90px;
}

.skill-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Efecto de salto al pasar el mouse */
.skill-item:hover img {
    transform: translateY(-8px);
}

.skill-item span {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
}

/* =========================================
   MODO OSCURO
========================================= */
body.dark-mode {
    --primary-color: #e2e8f0;
    --bg-color: #020617;
    --text-color: #cbd5e1;
    --card-bg: #0f172a;
}

body.dark-mode .experience-card,
body.dark-mode .skill-tag {
    border-color: #1e293b;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body.dark-mode .content-section h3 {
    color: #ffffff;
}

/* =========================================
   RESPONSIVO (Móviles)
========================================= */
@media (max-width: 850px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 30px 20px;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px;
    }
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/*Invertir logos negros en modo oscuro para que se vean blancos */
body.dark-mode img[src*="github-color"] {
    filter: brightness(0) invert(1);
}
body.dark-mode img[src*="git"] {
    filter: brightness(0) invert(1);
}
body.dark-mode img[src*="sqlserver"] {
    filter: brightness(0) invert(1);
}