* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-section {
    width: 100%;
    max-width: 600px;
}

.upload-area {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 3px dashed #667eea;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.upload-area.dragover {
    border-color: #4CAF50;
    background: #f0f8f0;
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 15px;
}

.file-types {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 25px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.analysis-section {
    width: 100%;
    max-width: 1000px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.2rem;
    color: #666;
}

.results {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.results h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}



.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.analysis-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid;
    transition: transform 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-2px);
}

.analysis-card.pros {
    border-left-color: #4CAF50;
}

.analysis-card.cons {
    border-left-color: #f44336;
}

.analysis-card.areas {
    border-left-color: #2196F3;
}

.analysis-card.suggestions {
    border-left-color: #FF9800;
}

.analysis-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-card.pros h3 {
    color: #4CAF50;
}

.analysis-card.cons h3 {
    color: #f44336;
}

.analysis-card.areas h3 {
    color: #2196F3;
}

.analysis-card.suggestions h3 {
    color: #FF9800;
}

.content {
    color: #666;
    line-height: 1.6;
}

.content ul {
    list-style: none;
    padding-left: 0;
}

.content li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.content li:last-child {
    border-bottom: none;
}

.content li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    margin-right: 10px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.improve-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.improve-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.improve-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.new-analysis-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.new-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #c62828;
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Improved CV Section Styles */
.improved-cv-section {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.improved-cv-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}



.improvements-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 5px solid #4CAF50;
}

.improvements-summary h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.improvements-list {
    color: #666;
    line-height: 1.6;
}

.improvements-list ul {
    list-style: none;
    padding-left: 0;
}

.improvements-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.improvements-list li:last-child {
    border-bottom: none;
}

.improvements-list li:before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
    margin-top: 2px;
}

.cv-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 100%;
}

.cv-original, .cv-improved, .cv-english {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    border-left: 5px solid;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.cv-original {
    border-left-color: #667eea;
}

.cv-improved {
    border-left-color: #4CAF50;
}

.cv-english {
    border-left-color: #e74c3c;
}

.cv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cv-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cv-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    color: #666;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #999;
    color: #333;
    transform: scale(1.1);
}

.copy-btn-mini:hover {
    color: #2980b9;
    border-color: #2980b9;
}

.download-btn-mini:hover {
    color: #27ae60;
    border-color: #27ae60;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.copied {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
    animation: pulse 0.5s ease-in-out;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cv-original h3 {
    color: #667eea;
}

.cv-improved h3 {
    color: #4CAF50;
}

.cv-english h3 {
    color: #e74c3c;
}

.cv-content {
    background: white;
    border-radius: 10px;
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid #ddd;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Mejorar la presentación del texto del CV */
.cv-content strong,
.cv-content b {
    font-weight: 700;
    color: #2c3e50;
}

.cv-content em,
.cv-content i {
    font-style: italic;
    color: #7f8c8d;
}

.cv-content h1,
.cv-content h2,
.cv-content h3,
.cv-content h4 {
    color: #2c3e50;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
}

.cv-content h1 {
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.cv-content h2 {
    font-size: 1.2rem;
    color: #2980b9;
}

.cv-content h3 {
    font-size: 1.1rem;
    color: #34495e;
}

.cv-content ul,
.cv-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.cv-content li {
    margin-bottom: 5px;
}

.cv-content p {
    margin-bottom: 10px;
}

/* Estilos específicos para el contenido HTML del CV mejorado */
.cv-improved .cv-content h1 {
    font-size: 1.6rem;
    color: #2c3e50;
    border-bottom: 3px solid #27ae60;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.cv-improved .cv-content h2 {
    font-size: 1.3rem;
    color: #27ae60;
    margin-top: 20px;
    margin-bottom: 10px;
    border-left: 3px solid #27ae60;
    padding-left: 10px;
}

.cv-improved .cv-content h3 {
    font-size: 1.1rem;
    color: #34495e;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
}

.cv-improved .cv-content strong {
    color: #2c3e50;
    font-weight: 700;
}

.cv-improved .cv-content em {
    color: #7f8c8d;
    font-style: italic;
}

.cv-improved .cv-content ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.cv-improved .cv-content li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.cv-improved .cv-content p {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Estilos para el CV original (mantener formato simple) */
.cv-original .cv-content {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Estilos para el botón de copiar */
.copy-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Feedback visual para el botón de copiar */
.copy-btn.copied {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}



.english-copy-btn, .english-download-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    margin: 5px;
}

.english-copy-btn:hover, .english-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Tablet and medium screens */
@media (max-width: 1024px) {
    .cv-comparison {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results {
        padding: 25px 20px;
    }
    
    .cv-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cv-actions {
        align-self: flex-end;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    /* Improve mobile CV content readability */
    .cv-content {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .cv-content h1 {
        font-size: 1.3rem;
    }
    
    .cv-content h2 {
        font-size: 1.1rem;
    }
    
    .cv-content h3 {
        font-size: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .upload-area {
        padding: 20px 15px;
    }
    
    .cv-comparison {
        gap: 10px;
    }
    
    .cv-original, .cv-improved, .cv-english {
        padding: 12px;
    }
    
    .cv-content {
        font-size: 0.85rem;
    }
    
    .cv-content h1 {
        font-size: 1.2rem;
    }
    
    .cv-content h2 {
        font-size: 1rem;
    }
    
    .cv-content h3 {
        font-size: 0.9rem;
    }
}

/* Estilos profesionales para el CV original */
.cv-original .cv-content .cv-name {
    font-size: 1.6rem;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: 700;
}

.cv-original .cv-content .contact-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.cv-original .cv-content .contact-item {
    margin-bottom: 8px;
    color: #34495e;
    font-size: 0.95rem;
}

.cv-original .cv-content .section-title {
    font-size: 1.3rem;
    color: #3498db;
    margin-top: 20px;
    margin-bottom: 10px;
    border-left: 3px solid #3498db;
    padding-left: 10px;
    font-weight: 600;
}

.cv-original .cv-content .job-title {
    font-size: 1.1rem;
    color: #34495e;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
}

.cv-original .cv-content .date {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-style: italic;
}

.cv-original .cv-content .achievements {
    margin-left: 25px;
    margin-bottom: 15px;
}

.cv-original .cv-content .achievements li {
    margin-bottom: 8px;
    line-height: 1.4;
    color: #2c3e50;
}

.cv-original .cv-content .cv-paragraph {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #2c3e50;
}

/* Estilos para botones de editar */
.edit-btn-mini {
    background: #28a745 !important;
    color: white !important;
}

.edit-btn-mini:hover {
    background: #218838 !important;
    transform: scale(1.05);
}

/* Modal de Edición */
.edit-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.edit-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.edit-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Toolbar de edición */
.edit-toolbar {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
}

/* Área de contenido editable */
.edit-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    min-height: 400px;
}

.edit-textarea {
    width: 100%;
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: white;
    outline: none;
    overflow-y: auto;
    resize: vertical;
}

.edit-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-textarea h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: #333;
}

.edit-textarea h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 15px 0 8px 0;
    color: #444;
}

.edit-textarea h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 12px 0 6px 0;
    color: #555;
}

.edit-textarea strong {
    font-weight: 600;
    color: #333;
}

.edit-textarea em {
    font-style: italic;
    color: #666;
}

.edit-textarea ul, .edit-textarea ol {
    margin: 10px 0;
    padding-left: 20px;
}

.edit-textarea li {
    margin: 5px 0;
}

/* Footer del modal */
.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.edit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.save-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.save-btn:active {
    transform: translateY(0);
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .edit-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .edit-toolbar {
        padding: 10px 15px;
        gap: 5px;
    }
    
    .toolbar-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .edit-content {
        padding: 15px;
    }
    
    .edit-modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .edit-btn {
        width: 100%;
        justify-content: center;
    }
}