/* 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;
}

/* Anuncios */
.ad-banner {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #ced4da;
    border-radius: 8px;
    margin: 20px 0;
    padding: 20px;
    text-align: center;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.ad-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #adb5bd;
}

.ad-placeholder.vertical {
    height: 300px;
}

/* 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 auto;
    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 */
.app-footer {
    text-align: center;
    padding: 30px 0;
    color: #6c757d;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

.app-footer p:first-child {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* 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;
}

/* 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;
}




/* ===== ESTILOS PARA POPUPS DE ANUNCIOS (EDITOR) ===== */

/* Overlay para popups */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.active {
    display: flex;
}

/* Contenido del popup */
.popup-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: popupIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header del popup */
.popup-header {
    background: linear-gradient(135deg, #3a6ea5 0%, #2d5a8a 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.popup-header h3 i {
    font-size: 1.2rem;
}

/* Botón cerrar popup */
.close-popup {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Cuerpo del popup */
.popup-body {
    padding: 30px 25px;
    text-align: center;
}

.popup-body p {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

/* Anuncio dentro del popup */
.popup-ad {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.popup-ad:hover {
    border-color: #3a6ea5;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(58, 110, 165, 0.15);
}

.popup-ad i {
    font-size: 3rem;
    color: #3a6ea5;
    margin-bottom: 15px;
    display: block;
}

.popup-ad h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.popup-ad p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Botones del popup */
.popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.popup-btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 140px;
}

.popup-btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.popup-btn-primary:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.popup-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.popup-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Contador de tiempo */
.popup-timer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.popup-timer p {
    font-size: 0.9rem;
    color: #95a5a6;
    margin-bottom: 5px;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #3a6ea5;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 5px;
}

/* Popup pequeño (para notificaciones) */
.small-popup {
    max-width: 400px;
}

.small-popup .popup-body {
    padding: 25px;
}

/* Popup lateral */
.side-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9997;
    animation: slideInRight 0.5s ease;
    border-left: 4px solid #3a6ea5;
    overflow: hidden;
    display: none;
}

.side-popup.active {
    display: block;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.side-popup-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.side-popup-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.side-popup-body {
    padding: 20px;
}

.side-popup-body p {
    margin: 0 0 15px 0;
    color: #5a6c7d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.side-popup-close {
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.side-popup-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Banner inferior */
.bottom-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 20px;
    z-index: 9996;
    display: none;
    animation: slideUp 0.5s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.bottom-banner.active {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.bottom-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.bottom-banner-text {
    flex: 1;
    min-width: 300px;
}

.bottom-banner-text p {
    margin: 0;
    font-size: 0.95rem;
    color: #ecf0f1;
}

.bottom-banner-actions {
    display: flex;
    gap: 10px;
}

.banner-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

.banner-btn-primary {
    background: #3a6ea5;
    color: white;
}

.banner-btn-primary:hover {
    background: #2d5a8a;
}

.banner-btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.banner-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-banner {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-banner:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}