/* ==========================================
   CV Builder Publico - Estilos
   ========================================== */

.cv-builder-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

.editor-panel {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow-y: auto;
    max-height: calc(100vh - 150px);
}

.preview-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.section-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #000C4F;
}

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

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #000C4F;
    margin: 0;
}

.btn-add-item {
    font-size: 14px;
    padding: 6px 12px;
}

.cv-item {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.cv-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.preview-iframe {
    width: 100%;
    height: calc(100vh - 300px);
    border: none;
    background: #fff;
    border-radius: 8px;
}

.template-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.template-card {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.template-card:hover {
    border-color: #000C4F;
    transform: translateY(-2px);
}

.template-card.active {
    border-color: #000C4F;
    background: #e8eaf6;
}

.template-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.action-buttons {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

/* Color picker */
.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    display: inline-block;
    margin-right: 6px;
    transition: all 0.2s;
}
.color-option:hover { transform: scale(1.15); }
.color-option.active { border-color: #333; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333; }

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, #000C4F 0%, #1a237e 100%);
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

/* Forzar texto blanco en fondos azules (override global.css: body:not(.home-page) = 0-1-2) */
body:not(.home-page) .cta-banner,
body:not(.home-page) .cta-banner div,
body:not(.home-page) .cta-banner span,
body:not(.home-page) .cta-banner strong,
body:not(.home-page) .cta-banner p,
body:not(.home-page) .cta-banner i,
body:not(.home-page) .cta-banner a:not(.btn) {
    color: #fff !important;
}
body:not(.home-page) .cta-banner a.btn-light { color: #000C4F !important; }

body:not(.home-page) #registerModal .modal-header,
body:not(.home-page) #registerModal .modal-header h5,
body:not(.home-page) #registerModal .modal-header i,
body:not(.home-page) #registerModal .modal-header span {
    color: #fff !important;
}

/* Mobile responsive */
@media (max-width: 991px) {
    .cv-builder-container {
        flex-direction: column;
    }
    .editor-panel, .preview-panel {
        max-height: none;
    }
    .preview-panel {
        position: static;
    }
    .preview-iframe {
        height: 500px;
    }
}
