:root {
    --primary-color: #1a56db; /* Azul profesional */
    --secondary-color: #2563eb;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --light-text: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

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

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

.container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.site-header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.site-header h1 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.site-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.language-selector {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.language-selector select {
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: white;
}

.cv-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.cv-form h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-section h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.form-section h3 .help-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.form-section h3 .help-btn:hover {
    background-color: rgba(26, 86, 219, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s;
    margin: 0.25rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--light-text);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.remove-exp-btn,
.remove-edu-btn {
    background-color: var(--error-color);
    color: white;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.remove-exp-btn:hover,
.remove-edu-btn:hover {
    background-color: #dc2626;
}

#add-experience,
#add-education {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

#add-experience:hover,
#add-education:hover {
    background-color: #059669;
}

.photo-section {
    display: none; /* Will be shown by JS when needed */
}

.photo-section .form-group {
    text-align: center;
}

#photo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
    color: var(--light-text);
    font-size: 0.9rem;
    overflow: hidden;
}

#photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

#photo-preview p {
    display: block;
}

.cv-preview {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.cv-preview h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.cv-template {
    min-height: 400px;
    padding: 2rem;
    background-color: #fdfdfd;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    max-width: 100%;
}

.cv-template > * {
    max-width: 100%;
}

/* Make sure embedded CV templates don't overflow on mobile */
.cv-template .euro-cv,
.cv-template .ats-modern,
.cv-template .cre-cv {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}

.cv-template .euro-header {
    flex-wrap: wrap !important;
}

.cv-template .cre-cv {
    flex-direction: column !important;
}

.cv-template .cre-sidebar {
    width: 100% !important;
}

@media (min-width: 768px) {
    .cv-template .cre-cv {
        flex-direction: row !important;
    }
    .cv-template .cre-sidebar {
        width: 220px !important;
    }
}

.cv-template .euro-contact {
    flex-wrap: wrap !important;
    gap: 8px !important;
}

/* Help tooltip responsive */
.help-tooltip {
    max-width: min(250px, 80vw) !important;
    font-size: clamp(0.8rem, 3vw, 0.9rem) !important;
}

.export-section {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.export-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.site-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--light-text);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* Responsive breakpoints */
@media (min-width: 600px) {
    .container {
        width: 95%;
        padding: 1.5rem;
    }
    
    .cv-form {
        padding: 2.5rem;
    }
    
    .form-section h3 {
        font-size: 1.3rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        width: 80%;
        padding: 2rem;
    }
    
    .cv-form,
    .cv-preview,
    .export-section {
        padding: 3rem;
    }
    
    .form-section h3 {
        font-size: 1.4rem;
    }
    
    .language-selector {
        font-size: 1rem;
    }
    
    /* Two-column layout for larger screens */
    .form-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    /* Make experience and education containers wider on large screens */
    #work-experience-container,
    #education-container {
        max-width: 100%;
    }
}

/* Touch target minimum size */
button,
input,
select,
textarea {
    min-height: 44px;
}

/* Help tooltip/styling - simple version */
.help-tooltip {
    position: fixed;
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 1000;
    pointer-events: none;
    max-width: 250px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print styles for CV */
@media print {
    body {
        background-color: white;
    }
    
    .site-header,
    .language-selector,
    .template-selector,
    .help-btn,
    .add-btn,
    .remove-btn,
    .photo-section,
    .export-section,
    .site-footer {
        display: none !important;
    }
    
    .cv-form,
    .cv-preview {
        box-shadow: none;
        border: none;
        margin: 0;
        width: 100%;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .cv-template {
        padding: 1.5cm;
        min-height: unset;
    }
}