/* ==================== VARIABLES Y ESTILOS GENERALES ==================== */
:root {
    --primary-dark: #2c3e50;
    --secondary-dark: #34495e;
    --accent-blue: #3498db;
    --accent-orange: #e74c3c;
    --light-gray: #ecf0f1;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: #f8f9fa;
    line-height: 1.6;
}

.cv-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* ==================== HEADER / SECCIÓN DE PERFIL ==================== */
.header-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
}

.header-section > .container-fluid {
    position: relative;
    z-index: 1;
}

.profile-img-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.05);
}

.edit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-orange);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.edit-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.name-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    outline: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.name-title:hover,
.name-title:focus {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.profession-title {
    font-size: 1.3rem;
    color: var(--accent-blue);
    margin: 10px 0 0 0;
    font-weight: 500;
    outline: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.profession-title:hover,
.profession-title:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #ecf0f1;
}

.contact-item i {
    color: var(--accent-orange);
    width: 25px;
    font-size: 1.1rem;
}

.contact-item span {
    outline: none;
    padding: 3px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.contact-item span:hover,
.contact-item span:focus {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ==================== SECCIONES GENERALES ==================== */
.cv-section {
    padding: 40px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.cv-section:last-of-type {
    border-bottom: none;
}

.section-title {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--accent-blue);
    animation: slideIn 0.6s ease;
}

.section-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--accent-orange);
    font-size: 1.6rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-content {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.8;
}

[contenteditable="true"] {
    padding: 5px 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
    outline: none;
}

[contenteditable="true"]:hover,
[contenteditable="true"]:focus {
    background-color: rgba(52, 152, 219, 0.1);
    border: 1px solid var(--accent-blue);
}

/* ==================== SECCIÓN SOBRE MÍ ==================== */
.about-section {
    background: linear-gradient(to right, rgba(52, 152, 219, 0.05), transparent);
}

.about-section .section-content {
    font-size: 1.05rem;
    color: var(--text-dark);
}

/* ==================== SECCIÓN CONTACTO ==================== */
.contact-section {
    background-color: #f8f9fa;
}

.contact-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.2);
}

.contact-card i {
    font-size: 2.2rem;
    color: var(--accent-orange);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.contact-card:hover i {
    color: var(--accent-blue);
    transform: scale(1.2);
}

.contact-card h4 {
    font-weight: 600;
    color: var(--primary-dark);
    margin: 15px 0 10px;
    font-size: 1.1rem;
}

.contact-card p {
    color: var(--text-light);
    margin: 0;
    outline: none;
}

/* ==================== SECCIÓN HABILIDADES ==================== */
.skills-section {
    background: linear-gradient(to right, rgba(231, 76, 60, 0.05), transparent);
}

.skill-item {
    margin-bottom: 25px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-header span:first-child {
    font-weight: 600;
    color: var(--primary-dark);
    outline: none;
}

.skill-level {
    background: var(--accent-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.progress {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-orange));
    border-radius: 10px;
    transition: width 0.6s ease;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

/* ==================== SECCIÓN IDIOMAS ==================== */
.languages-section {
    background-color: #f8f9fa;
}

.language-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--accent-blue);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.language-card:hover {
    transform: translateY(-5px);
    border-left-color: var(--accent-orange);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.15);
}

.language-card h4 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
    outline: none;
}

.language-level {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.stars {
    color: var(--accent-orange);
    font-size: 1.1rem;
    letter-spacing: 4px;
}

/* ==================== SECCIÓN EDUCACIÓN ==================== */
.education-section {
    background: linear-gradient(to right, rgba(52, 152, 219, 0.05), transparent);
}

.education-item {
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-blue);
    background: white;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    left: 0;
}

.education-item::before {
    content: '';
    position: absolute;
    left: -2px;
    top: -10px;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    z-index: 2;
}

.education-item:hover {
    background: linear-gradient(to right, rgba(52, 152, 219, 0.05), white);
    left: 5px;
    box-shadow: 0 3px 12px rgba(52, 152, 219, 0.15);
}

.education-item:hover::before {
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 15px;
}

.education-header h4 {
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
    outline: none;
    flex: 1;
}

.date {
    background: var(--accent-blue);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    outline: none;
}

.institution {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-orange);
    margin: 8px 0;
    outline: none;
}

.description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
    outline: none;
}

/* ==================== SECCIÓN EXPERIENCIA ==================== */
.experience-section {
    background-color: #f8f9fa;
}

.experience-item {
    padding: 25px;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    border-top: 4px solid var(--accent-orange);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.experience-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-blue);
    border-radius: 0 8px 8px 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.experience-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.experience-item:hover::after {
    opacity: 1;
    right: 0;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 15px;
    flex-wrap: wrap;
}

.experience-header h4 {
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
    font-size: 1.2rem;
    outline: none;
    flex: 1;
}

.experience-header .date {
    background: var(--accent-orange);
    white-space: nowrap;
}

.company {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin: 8px 0 15px 0;
    outline: none;
}

.experience-details {
    list-style: none;
    margin: 0;
    padding: 0;
}

.experience-details li {
    padding-left: 25px;
    margin-bottom: 10px;
    color: var(--text-light);
    position: relative;
    outline: none;
}

.experience-details li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-orange);
    font-size: 1.5rem;
}

/* ==================== FOOTER ==================== */
.cv-footer {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    border-top: 3px solid var(--accent-orange);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .header-section {
        padding: 30px 15px;
    }

    .profile-img {
        width: 150px;
        height: 150px;
    }

    .name-title {
        font-size: 1.8rem;
    }

    .profession-title {
        font-size: 1.1rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .education-header,
    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .date {
        align-self: flex-start;
    }

    .contact-info {
        margin-top: 15px;
    }
}

@media (max-width: 576px) {
    .cv-container {
        box-shadow: none;
    }

    .header-section {
        padding: 20px 10px;
    }

    .header-section > .container-fluid .row {
        flex-direction: column;
        text-align: center;
    }

    .header-section .col-md-3,
    .header-section .col-md-6 {
        width: 100%;
        margin-bottom: 15px;
    }

    .profile-img {
        width: 130px;
        height: 130px;
    }

    .name-title {
        font-size: 1.5rem;
    }

    .profession-title {
        font-size: 1rem;
    }

    .section-title h2 {
        font-size: 1.3rem;
    }

    .contact-info {
        display: grid;
        grid-template-columns: 1fr;
    }

    .skill-header {
        flex-wrap: wrap;
    }
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cv-section {
    animation: fadeIn 0.8s ease;
}
