/* ================================================
   CV PAGE — colores coordinados con el sistema oscuro/morado
   ================================================ */

/* Variables locales por si global.css no carga */
:root {
    --color-primary: #9333EA;
    --color-secondary: #6366F1;
    --color-accent: #A855F7;
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* El body ya tiene el fondo oscuro de global.css */
body {
    background-color: #0A0514;
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(147,51,234,0.18) 0px, transparent 55%),
        radial-gradient(ellipse at 100% 80%, rgba(99,102,241,0.15) 0px, transparent 55%);
    font-family: var(--font-main);
}

.cv-wrapper {
    min-height: 100vh;
}

/* ── Header / barra superior ── */
.cv-header {
    background: rgba(10,5,20,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(147,51,234,0.3);
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}
.back-link:hover {
    color: var(--color-accent);
    transform: translateX(-3px);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1.4rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: var(--font-main);
    box-shadow: 0 4px 14px rgba(147,51,234,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(147,51,234,0.6);
}

/* ── Contenedor principal del CV ── */
.cv-container {
    max-width: 900px;
    margin: 2.5rem auto;
    background: rgba(19,13,42,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(147,51,234,0.25);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(147,51,234,0.1);
    padding: 3rem 3.5rem;
}

/* ── Perfil ── */
.cv-profile {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(147,51,234,0.2);
}

.profile-image img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(147,51,234,0.6);
    box-shadow: 0 0 28px rgba(147,51,234,0.4);
}

.profile-info h1 {
    font-size: 2.2rem;
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.profile-info h2 {
    font-size: 1.05rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 0.9rem;
}

.profile-contact {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.profile-contact p {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
}

/* ── Secciones ── */
.cv-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(147,51,234,0.4);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.1em;
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Items de experiencia/educación ── */
.experience-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(147,51,234,0.1);
}
.experience-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.item-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.item-date {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    background: rgba(147,51,234,0.18);
    border: 1px solid rgba(147,51,234,0.35);
    border-radius: 9999px;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-company {
    color: rgba(168,85,247,0.9);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.6rem;
}

.item-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.item-list li {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    line-height: 1.65;
    padding-left: 1.1rem;
    position: relative;
}
.item-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

/* Texto de descripción de educación */
.cv-section > .experience-item > p:last-child {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    line-height: 1.65;
    margin-top: 0.4rem;
}

/* ── Skills grid ── */
.skills-grid-cv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
}

.skill-category {
    background: rgba(42,18,80,0.6);
    border: 1px solid rgba(147,51,234,0.2);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.skill-category:hover {
    border-color: rgba(147,51,234,0.45);
    box-shadow: 0 0 18px rgba(147,51,234,0.2);
}

.skill-category h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.6rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    background: rgba(147,51,234,0.2);
    border: 1px solid rgba(147,51,234,0.35);
    color: rgba(255,255,255,0.85);
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.skill-tag:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-color: transparent;
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .cv-container {
        margin: 1rem;
        padding: 1.75rem 1.25rem;
    }
    .cv-profile {
        flex-direction: column;
        text-align: center;
    }
    .item-header {
        flex-direction: column;
        gap: 0.3rem;
    }
    .skills-grid-cv {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .skills-grid-cv {
        grid-template-columns: 1fr;
    }
    .cv-header {
        padding: 0.9rem 1rem;
    }
}

/* ── Print ── */
@media print {
    .cv-header { display: none; }
    body { background: #fff !important; }
    .cv-wrapper { background: #fff !important; }
    .cv-container {
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 1.5rem !important;
        border-radius: 0 !important;
    }
    .section-title { color: #111 !important; border-bottom-color: #9333ea !important; }
    .section-title::before { background: #9333ea !important; }
    .item-header h4, .profile-info h1 { color: #111 !important; }
    .profile-info h2, .item-company { color: #7e22ce !important; }
    .item-list li, .profile-contact p { color: #444 !important; }
    .item-date { background: #f3e8ff !important; color: #7e22ce !important; border-color: #d8b4fe !important; }
    .skill-category { background: #faf5ff !important; border-color: #e9d5ff !important; }
    .skill-category h4 { color: #7e22ce !important; }
    .skill-tag { background: #ede9fe !important; border-color: #c4b5fd !important; color: #4c1d95 !important; }
    .cv-section { page-break-inside: avoid; }
}

/* Iconos en datos de contacto */
.profile-contact p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.profile-contact p i {
    color: var(--color-accent);
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Botón de descarga con icono */
.btn-download i { margin-right: 0.35rem; }

/* Back link con icono */
.back-link i { font-size: 0.85rem; }
