/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.app-header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.app-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Editor */
.editor-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.editor-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.editor-card h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.editor-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.editor-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Diseño selector */
.design-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.design-btn {
    padding: 20px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.design-btn:hover {
    border-color: #333;
    transform: translateY(-2px);
}

.design-btn.active {
    border-color: #333;
    background-color: rgba(51, 51, 51, 0.1);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.15);
}

.design-btn i {
    font-size: 2rem;
    color: #333;
}

.design-btn span {
    font-weight: 500;
    color: #444;
}

/* Selector de color */
.color-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .color-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.color-option:hover {
    border-color: #aaa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.color-option.active {
    border-color: #333;
    background-color: rgba(51, 51, 51, 0.1);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.15);
    transform: translateY(-2px);
}

.color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #ddd;
    transition: all 0.3s ease;
}

.color-option.active .color-circle {
    box-shadow: 0 0 0 2px #333;
    transform: scale(1.1);
}

.color-option span {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.custom-color {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.custom-color label {
    font-weight: 600;
    color: #444;
}

#custom-color-picker {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#color-hex {
    font-family: monospace;
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    background: white;
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* Foto upload */
.photo-upload-area {
    text-align: center;
    margin-bottom: 25px;
}

.photo-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 3px dashed #ddd;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-container:hover {
    border-color: #333;
    background: rgba(51, 51, 51, 0.05);
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.photo-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Formulario */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

/* Controles de secciones */
.section-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.section-controls .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Secciones del CV */
.cv-sections {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.section-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #333;
    transition: all 0.3s ease;
}

.section-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h4 {
    color: #333;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-buttons {
    display: flex;
    gap: 5px;
}

.section-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.section-btn:hover {
    background-color: rgba(0,0,0,0.05);
    color: #333;
}

.section-btn.delete-section:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.section-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.section-input:focus {
    outline: none;
    border-color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    color: #333;
    background-color: rgba(0,0,0,0.05);
}

.section-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .section-types {
        grid-template-columns: 1fr;
    }
}

.section-type {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.section-type:hover {
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.15);
}

.section-type i {
    font-size: 2rem;
    color: #333;
}

.section-type span {
    font-weight: 500;
    color: #444;
    font-size: 0.95rem;
}

.custom-section {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.custom-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.custom-section input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 15px;
}

.custom-section input:focus {
    outline: none;
    border-color: #333;
}

#create-custom-section {
    width: 100%;
}

/* Action section */
.action-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.save-note {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Preview */
.preview-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.preview-card h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-preview {
    min-height: 800px;
    background: white;
    padding: 40px;
    border-radius: 4px;
    border: 1px solid #eee;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    overflow-y: auto;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #333;
    color: white;
}

.btn-primary:hover {
    background: #555;
}

.btn-outline {
    background: transparent;
    color: #333;
    border: 2px solid #333;
}

.btn-outline:hover {
    background: rgba(51, 51, 51, 0.1);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
    width: 100%;
}

/* Footer */
.view-footer {
    text-align: center;
    padding: 30px 0;
    color: #6c757d;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, #333, transparent);
    margin-bottom: 25px;
}

.footer-main-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.footer-subtext {
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: #28a745;
}

.footer-credits {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-link {
    color: #3a6ea5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #2d5a8a;
    text-decoration: underline;
}

.separator {
    color: #adb5bd;
}

.copyright {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.copyright-symbol {
    font-size: 0.8rem;
}

.copyright-text {
    font-size: 0.85rem;
}

.rights {
    font-size: 0.85rem;
}

.footer-year {
    font-family: monospace;
    font-weight: bold;
    color: #495057;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.footer-note {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.warning {
    background: #ffc107;
    color: #333;
}

/* Scrollbar */
.cv-sections::-webkit-scrollbar,
.cv-preview::-webkit-scrollbar {
    width: 8px;
}

.cv-sections::-webkit-scrollbar-track,
.cv-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cv-sections::-webkit-scrollbar-thumb,
.cv-preview::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.cv-sections::-webkit-scrollbar-thumb:hover,
.cv-preview::-webkit-scrollbar-thumb:hover {
    background: #555;
}