/**
* @name        CV Digital - Isaac Ponce
* @author      Isaac Ponce (iponced.com)
* @version     1.0
* @copyright   Copyright (c) 2025 Isaac Ponce. All Rights Reserved.
*/

/* --- 1. TEMAS Y VARIABLES GLOBALES --- */
:root {
    --bg-color: #f5f5f7;
    --card-color: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --accent-color: #4a6b05;
    --border-color: #d2d2d7;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s ease;
}

html[data-theme='dark'] {
    --bg-color: #121212;
    --card-color: #1e1e1e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent-color: #8BC34A;
    --border-color: #3a3a3c;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- CONTROLES SUPERIORES --- */
.top-controls {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.language-switcher {
    background-color: var(--card-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color var(--transition-speed);
}
.language-switcher:hover {
    border-color: var(--accent-color);
}
.theme-switch-wrapper {
    position: relative;
    top: auto;
    right: auto;
}

/* --- ESTILOS DEL INTERRUPTOR DE TEMA --- */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.4s ease;
}
.knob {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--card-color);
    border-radius: 50%;
    transition: transform 0.4s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
input:checked ~ .slider { 
    background-color: var(--accent-color);
}
input:checked ~ .slider .knob { 
    transform: translateX(26px);
}

.knob svg {
    width: 18px;
    height: 18px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    position: absolute;
}


.knob .sun-icon {
    color: var(--accent-color);
    opacity: 1;
    transform: rotate(0);
}
.knob .moon-icon {
    color: var(--accent-color);
    opacity: 0;
    transform: rotate(90deg);
}

/* Estado activado (Modo Oscuro) */
input:checked ~ .slider .knob .sun-icon { 
    opacity: 0;
    transform: rotate(90deg);
}
input:checked ~ .slider .knob .moon-icon { 
    opacity: 1;
    transform: rotate(0);
}

/* --- 2. ESTILOS BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}
.main-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 1rem;
}
ul {
    padding-left: 20px;
    list-style: disc;
}
li {
    margin-bottom: 0.5rem;
}
strong {
    font-weight: 500;
    color: var(--text-primary);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- 3. COMPONENTES --- */
#print-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#print-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.cv-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
    margin-bottom: 3rem;
}
.profile-photo {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}
.profile-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-color);
    box-shadow: var(--shadow);
}
.header-info h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.header-info h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.95rem;
}
.contact-info a {
    color: var(--accent-color);
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}
.cv-section {
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: background-color var(--transition-speed);
}
.profile-summary {
    border-bottom: none;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}
.job-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}
.job-date {
    font-style: italic;
    color: var(--text-secondary);
}
.job .stack {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
#certificaciones ul {
    list-style: none;
    padding-left: 0;
}
footer {
    text-align: center;
    padding: 0.75rem 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    transition: border-color var(--transition-speed);
}
footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}
footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- 4. DISEÑO RESPONSIVO --- */
@media (max-width: 768px) {
    body { font-size: 15px; }
    .main-container { margin: 1rem auto; padding-top: 4rem; }
    .top-controls { top: 1rem; right: 1rem; }
    .cv-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    .contact-info {
        justify-content: center;
    }
    #print-button {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* --- 5. ESTILOS DE IMPRESIÓN --- */
@media print {
    :root {
        --font-color: #333333;
        --line-color: #cccccc;
    }
    body {
        background-color: #fff !important;
        color: #000 !important;
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 11pt !important;
        line-height: 1.6 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    #print-button, .top-controls, footer { display: none !important; }
    .main-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 2cm !important;
        background: none !important;
        box-shadow: none !important;
    }
    .cv-header, .cv-section, .contact-info, .skills-list {
        display: block !important;
        background: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        text-align: left !important;
    }
    strong {
        font-weight: bold !important;
    }
    .cv-header { margin-bottom: 1rem !important; }
    .profile-photo { display: none !important; }
    .header-info h1 { font-size: 2.5rem !important; margin-bottom: 0.25rem !important; }
    .header-info h2 { font-size: 1.2rem !important; margin-bottom: 1rem !important; }
    .contact-info {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0 !important;
    }
    .contact-info span, .contact-info a {
        font-size: 0.9rem !important;
        color: #000 !important;
        text-decoration: none !important;
        margin-right: 0.5em;
    }
    .contact-info span + span::before,
    .contact-info span + a::before {
        content: "|";
        margin-right: 0.5em;
        color: #555;
    }
    .contact-info a[href*="linkedin"]::after {
        content: " (" attr(href) ")";
        font-size: 0.95em;
    }
    .cv-section { margin-bottom: 1.5rem !important; }
    .profile-summary { 
        margin-bottom: 1.5rem !important;
        border-bottom: none !important;
        text-align: justify !important;
    }
    .section-title {
        font-size: 1rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.1em !important;
        padding-bottom: 0.5rem !important;
        margin-bottom: 1rem !important;
        border-bottom: 2px solid #000 !important;
        color: #000 !important;
    }
    .job .stack {
        color: var(--text-primary);
    }
    .skills-list {
        column-count: 1;
    }
    .skills-list p {
        break-inside: avoid;
    }
    ul { list-style: disc !important; padding-left: 20px !important; }
    li { margin-bottom: 0.25rem !important; }
    #certificaciones ul { list-style: none !important; padding-left: 0 !important; }
}